- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 09:00 PM
Hi Buddies,Actually I have a requirement to use the previous object details for async business rule(has to use only async as it is a REST Call.),but i know that I can't find the previous object in async BR.Is there any way to get the details of the previous object to use in server side script in async BR
Thanks in advance....
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2018 10:40 PM
Hi Kiran,
Any how you won't be able to get the previous object. If you want previous object to send some old values I would recommend following:
1) use after insert/update business rule instead of async
2) create an event in event registry
3) create a script action and tag it to the above event
4) use gs.eventQueue() to trigger the event and send the values you want in event parameters from business rule from step 1
5) have the rest call in the script action code then you can get the event parameters using event.parm1 and event .parm2
This is as good as async functionality; you are executing rest call afterwards and not directly once record is inserted/updated.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-02-2018 10:40 PM
Hi Kiran,
Any how you won't be able to get the previous object. If you want previous object to send some old values I would recommend following:
1) use after insert/update business rule instead of async
2) create an event in event registry
3) create a script action and tag it to the above event
4) use gs.eventQueue() to trigger the event and send the values you want in event parameters from business rule from step 1
5) have the rest call in the script action code then you can get the event parameters using event.parm1 and event .parm2
This is as good as async functionality; you are executing rest call afterwards and not directly once record is inserted/updated.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-03-2018 03:01 AM
Thank U Brother for the quick reply...it worked out for me....I have another doubt that ,Is there any other way to invoke the webservice(where we can write the script for Rest)other than the Async BR and the script action through events..If yes,Reply me Bro
Thank you in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2018 05:04 AM
Hi Kiran,
Not sure of any other place, may be from workflow or schedule job you can call it but not sure for async part.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader