NSOA.wsapi.upsert(attributes,objects)
Use this function to add or modify data in OpenAir based on lookup attributes. The function returns an error if more than 1000 objects are passed in.
You can use an externalid field as a foreign key and add a record without querying first for an internal ID.
For more information about the SOAP API (Web Services), see XML API and SOAP API.
See also Making SOAP Calls.
Parameters
-
attributes {var} [required] — Array of Attribute objects.
-
objects {var} [required] — Array of OpenAir Complex Type objects, see NSOA.record.<complex type>( [id] ).
Returns
-
Array of UpdateResult objects.
Units Limit
-
40 units
+20 for each additional object passed
For more information, see Scripting Governance.
Since
-
November 16, 2013
Example
-
This sample creates a new category in OpenAir.
//Define a category object to create/update in OpenAir var category = new NSOA.record.oaCategory(); category.name = "Updated Category"; category.externalid = "555"; // Specify that the lookup is done by external_id and not by (default) internal ID var attribute = { name : "lookup", value : "externalid" }; // Invoke the upsert call var results = NSOA.wsapi.upsert( [attribute], [category] );
Note:This simple example does not show error checking, see Handling SOAP Errors.
See Code Samples for more examples.