Problems with JavaScript CodeGen in v10.0.0.1463

Steps to reproduce:

  1. Exported from my code-first .net server the RODL file and save as ChronRODA.rodl.
  2. Open ChronRODA.rodl with RemObjects Service Builder 10.0.0.1463.
  3. Press Validate button the verify and 2 Warnings appear.
    a. Warning: DataAbstract.rodl
    b. Warning: DataAbstract_Simple.rodl
  4. Ignore warnings as instructed.
  5. Change the Name and Namespace of my library to ChronRODA.
  6. Save changes.
  7. Select the CodeGen > JavaScript > Interface menu item.
  8. This generates the file.
  9. Press Save Code and save keeping the default name “ChronRODA_intf.js”
  10. Place in my project folder.
  11. Then copying the DataAbstract.js and DataAbstract4_intf.js from “…\RemObjects Software\Data Abstract for JavaScript\Source”.
  12. Place in my project folder.
  13. Then copying the RemObjectsSDK.js from “…\RemObjects Software\Data Abstract for JavaScript\Source”.
  14. Place in my project folder.
  15. Just opening my project before any of my code is executed an error appears in the “ChronRODA_intf.js” file “Uncaught ReferenceError: _RemObjects_DataAbstract_Servernamespace is not defined at ChronRODA_intf.js:3702”
  16. Attaching test project: NewRODATest.7z (53.7 KB)

Upon further investigation I think this is where part the issue is:

In the “…\RemObjects Software\Data Abstract for JavaScript\Source\DataAbstract4_intf.js” file is this

__namespace = this;
if ("RemObjects.DataAbstract.Server" != "") {
	var parts = "RemObjects.DataAbstract.Server".split(".");
	var current = this;
    for (var i = 0; i < parts.length; i++) {
		current[parts[i]] = current[parts[i]] || {};
		current = current[parts[i]];
    };
	__namespace = current;
};

I believe it should be this:

__namespace = this;
var __RemObjects_DataAbstract_Servernamespace = this;
if ("RemObjects.DataAbstract.Server" != "") {
    var parts = "RemObjects.DataAbstract.Server".split(".");
    var current = this;
    for (var i = 0; i < parts.length; i++) {
        current[parts[i]] = current[parts[i]] || {};
        current = current[parts[i]];
    };
    __namespace = current;
    __RemObjects_DataAbstract_Servernamespace = current;
};

If I Service Builder > CodeGen > JavaScript the

“…\RemObjects Software\Data Abstract for .NET\Source\RemObjects.DataAbstract.Server\DataAbstract.RODL”

and

“…\RemObjects Software\Data Abstract for .NET\Source\RemObjects.DataAbstract.Server\DataAbstract-Simple.RODL”

it appears there is another problem because that code does not work either.

Thx.
by some reasons DataAbstract4_intf.js wasn’t updated after changing Codegen.

Thanks, logged as bugs://83643

Hello

Could you upload you server’s RODL files here or to support@

They are required to reproduce this locally and to provide you a fix / workaround.

Thanks in advance

Hello

You are right about the change needed. However which exactly error did you get after applying this change?

bugs://83643 got closed with status fixed.

I have sent the file to support@ as requested.