When I create a record from a objectscript with the "rbv_api.createRecord"-function, this not run the "OnUpdate-triggers. My Expression-fields wil then not be updated. How can I, after this create, programatically update this record and my "Expression"-fields without edit and save the newly created record?
CreateRecord API does not run triggers as explained in chapter 6 page 44. As for expression field - please submit support request to follow up.
Support-request is registered
Hi,
I just read the documentation on chapter 6 pages 43-44, it says otherwise:
- rbv_api.createRecord(objDefName, arr)
This method creates a new Object record.
....
Note: The Object Script API does invoke triggers on create, on update and on delete the same way as the Rollbase user interface does.
If i'm not mistaken, the createRecord API WILL invoke "After Create" triggers BUT, it WILL NOT invoke "After Update" triggers since it is a Create Operation.
An option if you want to auto-update a record After Create (inclusive of Expression fields) is:
1. On the object that the new record is created, add another object script that will run "After Create"
2. Place this code within it and save:
var arr = []; rbv_api.updateRecord("objDefName", "{!id}", arr);
- this will invoke "After Update" triggers and also populate Expression Fields values
From the documentation, guidelines when using createRecord and updateRecord::
Important: createRecord() and updateRecord() API obser