SBM ModScript Reference → Programming SBM ModScript → Object Types → AppRecord → AppRecord Update() Method
(SBM On-Premise/PaaS only) This method updates the item in the database using the values from the item.
Parameter | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
bool |
Returns true if the record is updated in the database. |
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"); myRecord.Update(); 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.
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.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.