- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 07:48 PM
I have a customised table u_audit which inserts the INC record number whenever the INC is updated.For this I have created a customised string field(u_number) which captures INC number and I have created a customised field (u_count) on the audit table and I want to insert the counter(1,2,3,4,5...) on basis of insertion of INC record. For examples: when INC record is updated for 1st time a record should be inserted in u_audit table which populates u_number as INC number and u_count should be 1 and so on. Please can you let me know how to achieve this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2022 05:13 AM
If my answers helped you to resolve your queries then please mark them as correct or helpful based on the impact.
Thanks and Remarks
Abhijit
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 08:07 PM
Hi
can you please explain why you want to rebuild the auditing feature of ServiceNow? What is the underlying requirement for that? Or what was not possible to implement that you decided to create a custom table for auditing?
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 08:15 PM
I want to track the number of times the Incident is updated in a day for reporting purposes and what the number is...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 09:10 PM
Hi,
You can use flow or business rule to increment count. Use trigger condition so that BR/Flow will execute on every update and update the count for associated record in custom table.
Please try this logic by yourself and let us know if you stuck anywhere.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2022 09:24 PM
Hi,
I would suggest to check for HistoryWalker API, this API helps us to get all updated details for any record. It stores all the updates happened to the record.
You can find more details below,
If you still want to go for your solution then you would need to write on update/insert BR on incident table with below pseudo code.
if current.operation()=="insert" then insert new record in audit table with incident number and count =1
else if(current.operation()=="update") then get current incident record from audit table and increment count.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP