Timesheet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 02:42 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 03:06 AM
@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.