NSOA.form.setValue(field, value)

Use this command to set form values on the submit scripting event and to update values as part of the main form save, without needing to write WSAPI (SOAP) calls. The effect is the same as a user making manual changes to a field.

Example of value set using the NSOA.form.setValue function.

Full validation from your other scripts or rules is applied after the changes are made, ensuring your changes are safe. Form default values are applied before the script is run, and any permission rules or "After save" scripts are applied after the "On submit" script runs.

Error messages can be raised on the submit event. If errors are raised, the script will still run to completion, and the errors will be logged.

The function takes two parameters:

The NSOA.form.setValue function supports the following field types: text, text area, date, numeric, currency, days, hours, ratio, checkbox, dropdown, dropdown and text, pick list and radio group. The following field types are not supported: password, sequence and multiple selection.

See Examples for individual use cases.

Parameters

Note:

You can reference custom fields using either to the user-defined custom field name suffixed with _c (for example my_custom_radio_group_c or the internal custom field ID prefixed by custom_ and the (for example, custom_42). You should reference custom fields by their user-defined names to ensure your scripts are portable.

Returns

Units Limit

Since

April 15, 2017

Examples