Regarding the Async Business Rule...

Ganesh75
Giga Contributor

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....

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

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

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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...

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader