Stop a business rule when an update is done to the backend record through workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 06:06 AM
Hi,
I need to stop processing the business rule when an update is done to the back-end record through workflow.
When a request(RITM) is submitted to update a record value from the record producer the workflow is triggered to updated the record on the backend. We have a business rule written to create logs on a custom table when a record is updated, So even when a user updates the table record a log is created and when a request is submitted also a log is created. But we need to create records on when a workflow is triggered or when a user manually updates the record.
I tried using gs.getSession().isInteractive() but returns true for both of the above cases.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 06:21 AM
so the record in log should be created only when record gets updated from workflow and not from UI or from any user?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 09:24 PM
@Ankur BawiskarThe record in the log should get created when an request(RITM) is submitted and well as when a admin directly updates the ABC table. Ideally the log table record gets created when an update is made on the ABC table through the RITM or by the admin.
So we have business rule to create log records that runs when a value gets changed on the ABC table which is getting triggered. Because when a RITM is submitted the workflow will update the backend ABC table record and create a log record even the business rule will get triggered as there is an updated on the backend table. So duplicate records are getting triggered because of this.
So when an update happens to the backend record from the workflow we don't want the business rule to be triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 09:49 PM
It would be nice if you share screenshots and relevant scripts for better understanding
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2023 12:37 AM