- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 02:17 AM
Hello All,
I have doubt on when do we use following function new Workflow().broadcastEventToCurrentsContexts(grTarget, 'update', null) ?
Thanks and Regards,
Meenal
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 03:25 AM
Hi Meenal,
I believe the BR is on sc_task table and you want workflow of RITM to proceed on some update.
So the only way to make workflow of RITM proceed once task gets updated is the above script.
So I don't think any other way to handle this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 02:37 AM
Hi Meenal,
this is usually used to make the workflow trigger which is waiting for condition on another table.
Example: you have workflow on change request table and you want to wait till some field gets updated on incident table. In this case wait for condition only waits till update happens on the current record
In this case you cannot make the workflow wait on incident table as it is created on change req table
So what you will do is use BR after update on INC and use the above script to ensure any workflow waiting to move forward i.e. broadcast an update so that workflow proceeds.
check these links should help
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 03:10 AM
Hello Ankur,
Thanks for your response !
We have below code in business rule.which has been identified has slow running script in Health Scan can you suggest if this is normal behaviour of this method or can we do something else for performance optimization?
var grTarget = current.request_item.getRefRecord();
new Workflow().broadcastEventToCurrentsContexts(grTarget, 'update', null);
When to run Condition :
Type : After
Update
RITM.ITM is XYZ item or state= Closed Skipped
Many Thanks,
BR,
Meenal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 03:25 AM
Hi Meenal,
I believe the BR is on sc_task table and you want workflow of RITM to proceed on some update.
So the only way to make workflow of RITM proceed once task gets updated is the above script.
So I don't think any other way to handle this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader