AppRecord Update() Method

(SBM On-Premise/PaaS only) This method updates the item in the database using the values from the item.

Function Signature

 bool Update()


Parameter Type Description



Type Description


Returns true if the record is updated in the database.

Technical Details

SBM ModScript version: 11.3.


// Create a Contact record
var tableId = Ext.TableId("TS_CONTACTS");
var myRecord = Ext.CreateAppRecord(tableId);
var whereClause = "TS_CONTACTFIRSTNAME = 'Joe'";
if( myRecord.ReadWithWhere(whereClause) ) {
	// Get a lock, set the value, update and unlock
	var locked = myRecord.Lock();
	myRecord.SetFieldValue("CONTACTLASTNAME", "Smith");
	var unlocked = myRecord.Unlock();


The values of all fields in the calling AppRecord are written to the database. Any fields that the current user has privileges to update may be modified and the Update method commits them to the database. This method modifies an existing record, based on the TS_ID of the calling AppRecord. To add a new record, see the Add() method.

For VarRecords, this method replicates the functionality of the system Update transition.

Note: During Post-Transition, Post-State, and Pre-State scripts, it is not necessary to call Shell.Item().Update() because the system always calls Update after the script finishes. However, if you create any other AppRecord objects, you will need to call Update on those each of those objects; the system always calls Update only for Shell.Item().

Changes to cached items written with this method are not immediately available to other SBM servers that are connected to the same database. The other servers see these changes when the cache periodically synchronizes with the database. The time interval for cache updates can be configured and defaults to twenty seconds.

Related Topics


AppRecord UpdateWithLock() Method