Read and Update Data Record

The WFR code can read a database record, change its values, and save the updated record:

// read the record
DataRecord record = ds.getRecord();

// set new values
record.setValue('wr.date_approved', Utility.currentDate());
record.setValue('wr.approved_by', ContextStore.get().getUser().getName());

// save the record with new values
ds.saveRecord(record);

Note that you can use either saveRecord() or updateRecord() in the above code example.