- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2015 06:05 AM
HI Experts,
Need help , I have a business rule for certifications.
1) First thing is its working
2) It is executing twice
Details:
When Business rule is fired, it is checking the 'certification filter' and creates tasks , but twice . WHY? this is the issue . It should be generating only once not twice.
Any idea how to make it run only once i mean my code is:. THANKS
-----------------------------------------------------------------------------------------------------
function pdCertTest()
{
var rec = new GlideRecord('cert_schedule');
rec.get('name', 'Priority Incident Closure Certification');
if (typeof SncTriggerSynchronizer != 'undefined')
{
//gs.addInfoMessage("Execute..");
SncTriggerSynchronizer.executeNow(rec);
}
}
----------------------------------------------------------------------------------------------------
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2015 06:49 AM
There is no need of current.update() in before BR because after executing Before BRs system itself perform current.update() operation. On other hand the statement current.update() will lead to a loop of update of same record again and again. Check section 4 from below link and get more info on this.
http://wiki.servicenow.com/index.php?title=Business_Rules_Best_Practices
Just remove current.update() from before BR and everything it work will fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2015 03:05 AM
Yeah removed that and its working fine now. Resolved.
Thanks for support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 01:33 AM
Why do people use SncTriggerSynchronizer.executeNow(rec); over gs.executeNow(rec)? Is there a difference between both functions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 02:11 AM
Hi Peter,
I am not able to find out any documentation regarding gs.executeNow but SncTriggerSynchronizer.executeNow(rec) is referenced at several places.
If you configure the UI Action 'Execute Now' , you will get the same piece of code ( SncTriggerSynchronizer.executeNow(rec)).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 02:49 AM
It is clearly document on their developers pages though ServiceNow Developers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 03:03 AM
Hi Peter,
As mentioned in the documentation it works for scoped applications but not for Global.
This documentation is created recently when developer program was started and not available on Wiki.