Updating an Existing Object

If the object you want to update is the current row in which your script is executing, then just assign new values to the fields as needed.

However, if you need to update an object that is different from the current row, perform these steps:

  1. Use newView() to access the appropriate view object for programmatic access

  2. Find the object by id or find one or more objects using a view criteria, depending on your requirements

  3. Assign new values to fields on this row as needed

The changes will be saved as part of the current transaction when the user commits it.

Tip: See Avoiding Validation Threshold Errors By Conditionally Assigning Values for a tip about how to avoid your field assignments from causing an object to hit its validation threshold.