Business rule not working when inserting a record via REST API process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2016 07:01 AM
Good morning. I need a script tweak...
I have a BEFORE Business Rule that is setting the value of Date field as a Time Stamp
Here's the script that runs when it meets this condition.
(function executeRule(current, previous /*null when async*/) {
var now = new GlideDateTime();
current.u_inshold_glide_date = now;
})(current, previous);
This is working great when I update a record.
But, now we're inserting new records in our nightly process and I have another rule that is setting the "Insurance Hold?" to true on "Insert". That worked over night but it did not set the "Insurance Hold Date" as it does when I update. Then I went in to update and nothing changed.
Here's my question. If I just make "Insert = True" on the business rule above, and change the condition to IS True rather than "CHANGES To True" will it fix my issue?
The purpose of this is to put newly Inserted vendors on Insurance hold until someone has an opportunity to review their insurance documents.
What do you suggest?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2016 07:06 AM
Hi Carl,
Can you replace line current.u_inshold_glide_date = now; to current.u_inshold_glide_date = gs.now;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2016 07:11 AM
Also make sure insert is set to true and give order value higher for this rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2016 07:24 AM
Thanks Pradeep. Nothing happened after making the suggested changes.
I checked INSERT
Changed the order to 200
And added the "gs.now" as shown below
(function executeRule(current, previous /*null when async*/) {
var now = new GlideDateTime();
current.u_inshold_glide_date = gs.now;
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2016 05:03 AM
I'm having a similar issue.
We have some business rules, such as Company Projection which has order 100
When an incident is inserted via an external REST message, this business rule does not run