Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EEVVoGYyiop/g85XJkCkUk
Power Apps - Microsoft Dataverse
Answered

Business rule fires on server-side, but intermittently on the front end

Like (1) ShareShare
ReportReport
Posted on 18 Jun 2024 13:12:31 by 401

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).

CharlesS_0-1718716012617.png

4. If I change the Create Ticket by field, the fields shown change accordingly 

CharlesS_1-1718716056817.png

5. I save the record, and click New to create another record.

6. The business rule is no longer applied (all fields shown)

CharlesS_2-1718716124014.png

7. If I change the Create Ticket BY (which should show some fields, and hide others), nothing changes

CharlesS_3-1718716175679.png

 

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?

Categories:
  • Charles Seguin Profile Picture
    401 on 28 Jun 2024 at 13:57:06
    Re: Business rule fires on server-side, but intermittently on the front end

    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.

  • scaldwell Profile Picture
    6 on 20 Jun 2024 at 15:13:47
    Re: Business rule fires on server-side, but intermittently on the front end

    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.

  • Charles Seguin Profile Picture
    401 on 19 Jun 2024 at 01:50:41
    Re: Business rule fires on server-side, but intermittently on the front end

    @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.

  • Verified answer
    MarioRing Profile Picture
    541 Super User 2024 Season 1 on 18 Jun 2024 at 20:33:35
    Re: Business rule fires on server-side, but intermittently on the front end

    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.

  • Charles Seguin Profile Picture
    401 on 18 Jun 2024 at 19:08:11
    Re: Business rule fires on server-side, but intermittently on the front end

    @Michaelfp Our team was unable to find any relevant errors in the console 😞

  • MichaelFP Profile Picture
    1,831 Super User 2025 Season 1 on 18 Jun 2024 at 14:33:21
    Re: Business rule fires on server-side, but intermittently on the front end

    Yes devloper tool bar from the browser.

  • Charles Seguin Profile Picture
    401 on 18 Jun 2024 at 13:25:24
    Re: Business rule fires on server-side, but intermittently on the front end

    Which Developer Tool bar are you speaking of? F12 in the browser? 

  • MichaelFP Profile Picture
    1,831 Super User 2025 Season 1 on 18 Jun 2024 at 13:22:05
    Re: Business rule fires on server-side, but intermittently on the front end

    @CharlesS  On the developer tool bar did you notice any error? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
SadFox Profile Picture

SadFox 2

#1
CU06052020-0 Profile Picture

CU06052020-0 2

#1
stampcoin Profile Picture

stampcoin 2

Overall leaderboard

Featured topics