JSDO properties, methods, and events reference : setProperties( ) method
  

setProperties( ) method

Note: Applies to Progress Data Objects Version 4.3 or later.
Replaces all user-defined properties in the current JSDO instance with the user-defined properties defined in the specified object.
Return type: null
Applies to: progress.data.JSDO class

Syntax

setProperties ( propsObject )
propsObject
An Object containing a comma-separated list of name, value pairs that define the complete set of user-defined properties in the current JSDO, where name and value define a single property as defined for the setProperty( ) method. The properties defined in propsObject entirely replace all other user-defined properties previously defined in the JSDO. You can also remove all existing user-defined properties from the JSDO by specifying {} as the value of propsObject.
Note: Any user-defined property you create with name set to "server.count" has a reserved usage in JSDO plugins. For more information, see the description of the responseMapping function that you can define using the addPlugin( ) method.

Example

The following code fragment sets the "prop1" user-defined property in jsdoCustOrders to the value "12345". It then calls setProperties( ) to replace all of the existing user-defined properties in jsdoCustOrders with definitions for the two user-defined properties, "prop2" and "prop3" and writes the current values of "prop1", "prop2", and "prop3" to the console log:
jsdoCustOrders = new progress.data.JSDO(. . .);

jsdoCustOrders.setProperty("prop1", "12345");
jsdoCustOrders.setProperties({"prop2", 100, "prop3", "ABCD"});
console.log("prop1: " + jsdoCustOrders.getProperty("prop1"));
console.log("prop2: " + jsdoCustOrders.getProperty("prop2"));
console.log("prop3: " + jsdoCustOrders.getProperty("prop3"));
The output from the console.log statements in this example appear as follows:
prop1: undefined
prop2: 100
prop3: ABCD
Note that the value returned and written out for "prop1" is undefined, because a user-defined property with that name is no longer defined in the JSDO.

See also:

getProperties( ) method, setProperty( ) method