- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2017 02:31 PM
I have a business rule that is triggered whenever a particular field is changed. I have observed that for the most part, the rule works except for one instance.
This field is also modified in workflow that is attached to the same form. Because the process is complicated, all updates are accomplished via script, ie. current.<fieldname>. What I'm noticing is that the changing of the field in this manner does not appear to trigger the business rule. Am I supposed to only use the Set As activity in this instance and will it trigger the business rule? Or am I doing something else wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 01:28 PM
You are correct, in normal use, you would NOT update the current object in your business rule. ( I'm assuming that it is a BEFORE rule and that you're only operating on the current object ). The system will update the current object after all the BEFORE business rules have run.
So this leaves us with the question of why isn't the business rule running, and how do you know it's not running?
To this end, why not put a log message in your script, near the beginning. Something like:
gs.log("This BR is running");
Then run your workflow and examine the system log. Is this message there? Is there anything else related to the business rule in the log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2017 02:39 PM
It's possible that the script in the workflow has a statement like this:
ritm.setWorkflow(false);
( the text ritm may vary ).
This will allow the workflow script to update records without invoking other business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 07:03 AM
I don't see it in the script at all.
The script also doesn't have a current.update() line and I think there isn't supposed to be one when you are setting things on current in a script. At least that is what I was told.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2017 01:28 PM
You are correct, in normal use, you would NOT update the current object in your business rule. ( I'm assuming that it is a BEFORE rule and that you're only operating on the current object ). The system will update the current object after all the BEFORE business rules have run.
So this leaves us with the question of why isn't the business rule running, and how do you know it's not running?
To this end, why not put a log message in your script, near the beginning. Something like:
gs.log("This BR is running");
Then run your workflow and examine the system log. Is this message there? Is there anything else related to the business rule in the log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2017 06:49 AM
DOH
Business rule was running before, not after.
Thanks.