Modeling Services > Rogue Wave Script Integration > Accessing Server Objects from Scripts > Creating New Objects
 
Creating New Objects
You can create new objects using the Rogue Wave Script new operator. The script creates the new server object using its default constructor. This new object must be referenced by the server model or by a global variable; otherwise, it will be deleted when the script function leaves.
Note: If the class uses a dictionary, instances will be stored in the dictionary only if the identifier is a non-null value.
An object is referenced by Server when it is inserted into a server relation, or added to a dictionary, or referenced as a declared object. (See the static member function IlsMvServer::DeclObjectLabel.) If the type is an entity or has defined an identifier attribute, you can provide a string as the argument to the constructor. (See “Identified Objects”..)
Example
var d = new Domain("France");

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.