Timesheet

MohamedMostafa1
Tera Contributor

Hi All,

 

We are looking for mechanism to have flag against each timecard to show if record was inserted, updated or deleted, can we use any OBB option like querying log table, if applicable or any client implemented such option before.

1 REPLY 1

Sandeep Rajput
Tera Patron
Tera Patron

@MohamedMostafa1 You can create an onBefore business rule on your timecard table and check Insert/Update/Delete checkboxes. In script, you can check current.operation() to know if the operation is of type Insert/Update/Delete. You can save this value on your flag field on your record.

 

For more information please refer to https://developer.servicenow.com/dev.do#!/reference/api/washingtondc/server_legacy/c_GlideRecordAPI#...

 

PS: Setting the flag will work fine for Insert and Update operations. For delete, since the data is going to be deleted, I recommend making an entry of this record in any auxiliary table to track the deleted records.