A model-driven app using business rules has been working well in production for 2+ years. However, as of yesterday, the client-side (front-end) only works intermittently. I have replicated the issue in a simplified app, in a test environment, in order to isolate the problem.
Example:
1. I open the app (as sysadmin), and press CTRL+F5.
2. I open the entity view, and click on the New button.
3. Rule works well (fields shown are conditional based on the "Create Ticket By" field).
4. If I change the Create Ticket by field, the fields shown change accordingly
5. I save the record, and click New to create another record.
6. The business rule is no longer applied (all fields shown)
7. If I change the Create Ticket BY (which should show some fields, and hide others), nothing changes
Relaunching the app and refreshing the browser many times helps to make the business rules work once more... but it quickly stops working again as soon as a new record is once again created.
How can the erratic business rule behaviour be explained?
I am pleased to report that, pursuant to the support tickets opened by several customers, Microsoft pushed a backend fix to resolve this issue. As such, you should no longer be experiencing the issue described herein.
If you do experience similar problems, I encourage you to try the troubleshooting steps described by @MarioRing above.
We have had similar issues with Business Rules not firing on forms, specifically when creating 'New' records. These issues started about a week ago across our Dev/UAT/Prod environments. Like yourself, these are mature forms that have been in production for years. The problem seems like to have been introduced in a recent update. We currently have a ticket in with MS, hoping for a resolution soon.
@MarioRing Those are really good suggestions and I would advise anybody with similar issues to try all those things before trying the unlikely fix I describe below.
1. We created a Javascript Web Resource with the following (seemingly useless) code:
function run(executionContext) {
var formContext = executionContext.getFormContext().data.entity;
console.log("This JavaScript was deployed to correct a bug with the triggering of business rules. Triggering this JavaScript OnLoad effectively forces the business rules to trigger. Ref Microsoft Support Ticket: TrackingID#xyz")
}
2. We set an OnLoad event for this script in the relevant forms.
3. Somehow, running this script OnLoad seems to force all relevant business rules to trigger consistently.
We discovered this fix while developing the last resort solution suggested by MarioRing. We rewrote one of our business rules in JS and tested it, first with all other business rules off (it worked!). Then, we tested it with all other business rules on... not only did it work, but the other business rules started firing too!
We removed our newly created JS OnLoad event, and reactivated the original business rule the JS was meant to replace. Finally, we set tried the bizarre solution described above.
Because we cannot explain why this unlikely fix works, we do not consider this to be a permanent fix. Nevertheless, it should allow our users to operate normally for now.
We hope this information can be of assistance in the community's troubleshooting efforts.
Here are some of my suggestions that I would use if I were you:
Examine all JavaScripts on the form, and all business rules. Deactivate them one by one and explore the combinations. Perhaps different elements of the system affect the same element of the form, and the effect on the screen depends on which code happened to execute faster (therefore there is randomness).
Create the same business rule again.
Modify the "scope" parameter in Business Rule, then see how the system behaves after the change.
Create a new form for the same entity from scratch and check if the problem persists.
Check in another browser and in incognito mode. Clear cookies.
Worst case scenario - rewrite the business rule functionality as JavaScript.
@Michaelfp Our team was unable to find any relevant errors in the console 😞
Yes devloper tool bar from the browser.
Which Developer Tool bar are you speaking of? F12 in the browser?
@CharlesS On the developer tool bar did you notice any error?
SadFox
2
CU06052020-0
2
stampcoin
2