Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 10:17 PM
Hi Kiran,
Fire event triggers the workflow event to the workflow context from current record, however I think you want to trigger the event from one RITM's workflow context to another RITM's workflow context. You need to get the running context from RITM 2 in order to trigger the event to that workflow.
You need to query RITM table to find out the RITM record to which the other workflow is associated.
Try the following code:
var ritm = new GlideRecord("sc_req_item");
ritm.addQuery("request", current.request);
ritm.addQuery("sys_id", "!=", current.sys_id);
ritm.query();
while(ritm.next()) {
var wf = new Workflow().getRunningFlows(ritm);
while(wf.next()) {
new Workflow().broadcastEvent(wf.sys_id, 'Execute.Workflow.2');
}
}
Give it a try. Hope this helps!
Cheers,
Manish