NSOA.form.getNewRecord()
Use this function to get the entity record for a form with the newly saved values, for example oaProject.
This function should be called on the After save event, see Events.
See also NSOA.form.getOldRecord().
Parameters
-
(none)
Returns
-
OpenAir Complex Type object, see NSOA.record.<complex type>( [id] ).
Note:
This function will return null if called before the form has been saved.
Units Limit
-
1 unit
For more information, see Scripting Governance.
Since
-
November 16, 2013
Example
-
This example modifies the project notes after the project has been saved.
Note:This script would be called on the "After save" event for the Project form
// Get the new record values var newr = NSOA.form.getNewRecord(); // Create a new record with field to modify var project = new NSOA.record.oaProject(); project.id = newr.id; // Need to specify the internal ID project.notes = newr.notes + "\nAppended to notes: " + (new Date().toString()); // New value for field // Modify the notes NSOA.wsapi.disableFilterSet(true); // Drop user filters - make this a generic script var arrayOfupdateResult = NSOA.wsapi.modify([], [project]);
Note:This simple example does not show error checking, see Handling SOAP Errors.
See Code Samples for more examples.