- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:19 AM
(function executeRule(current, previous /*null when async*/ ) {
var gr = new GlideRecord("problem");
gr.initialize();
gr.short_description = current.short_description;
gr.insert();
gs.addInfoMessage(current.short_description);
gs.addInfoMessage(previous.short_description);
})(current, previous);
I wrote this async business rule on incident table for update, it does create problem as expected but it doesnot display any info message. I also added in actions tab, add message and that message is also not dsiplayed. Now is it part of functionality to behave this way ?, explaination would be appreciated. Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:48 AM
If you look closely at the out-of-the-box example script:
(function executeRule(current, previous /*null when async*/) {
So current will work, previous won't work. It clearly mentions null when async.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:25 AM
Hi there,
Yes this is correct. Since the business rule is running asynchronously.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:45 AM
so the info message doesnot work with asycn or the previous and current object won't work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:47 AM
Hi,
Info message will not work as there is no running order in async BR, but you can use both current and previous objects in BR, it will work.
Regards,
SS
Please mark an appropriate response as correct if my answer replied to your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 11:48 AM
If you look closely at the out-of-the-box example script:
(function executeRule(current, previous /*null when async*/) {
So current will work, previous won't work. It clearly mentions null when async.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
