Business rule not always running as expected

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 12:36 PM
We have a before business rule that should always run on insert/update (no other conditions) into the task_time_worked table via a time worked update on tasks, but about 1% of the time it does not run. The rule is intended to create/update time cards, but because of this issue, it's not doing so consistently. The record does get inserted, just triggers no business rules.
There does not appear to be any kind of a pattern to when this happens - it seems completely random.
I have searched high and low for other rules that may be preventing this rule from running (containing setWorkflow(false))
I'm at my wits end and need some advice on other ways to troubleshoot. I can't reproduce what's happening... and HI won't help; the rule is custom because we needed some additional functionality that the OOB rule did not provide.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 01:04 PM
Hi,
Can you post your BR?
If it's a simple insert/update be, then I guess we'll start by putting log statements and see when it gets stopped.
Also, have your tried searching your logs for errors?
harel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 01:10 PM
The rule is not running at all - it is supposed to create or update a time card and then write the time card id back to a custom field on the task_time_worked table and it works 99+% of the time. The very first statement in the rule is a log statement I added with details about the user, the task they put time on, and how much time they added. I compare these log statements with the task_time_worked entries that have no time card id and there are no log statements for those entries.
I have also added a before business rule on the task_time_worked table is set to Order = 1 and all it does is create a log statement - no log entry is generated from that rule in these cases either.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 01:05 PM
can you post a screenshot of the BR?
If you are updating a different table from task, the first thing is, you are suppose to use an onAfter BR.
If for some reason, the task record doesnt save, and you have a before BR, it will still update/insert records.
Also, are there records inserted via API or transform map, which has business rule run turned off. You should check that too.
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 01:12 PM
The only way to create a task_time_worked record is to add time to the time worked field in a task - there are no records being inserted in any other way.
I am doing this in a before business rule, because I want the sys_id from the time card that's created or updated to be written back to the task_time_worked record.