web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

JavaScript and Business Rules don't place nice together

(0) ShareShare
ReportReport
Posted on by

If I have business rules that address Field A and Field A has an onchange event handler, the business rules seem to be ignored.

Is there any way around this?  My only alternative is doing all the hide/showing from the business rules within the JS, which is a drag.

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi Deb,

    If you have a business rule that sets a field, that field change will not trigger the on change event handler for the field (I had to find this out the hard way a few months ago). If you have cascading logic like that I'm afraid you need to put it all in one mechanism or the other. Sorry.

    If this helps I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

    EDIT: Here's the details: https://technet.microsoft.com/en-us/library/dn531086.aspx#BKMK_Limitations

    When you set a field value by using a business rule, any OnChange event handlers for that field will not run. This is to reduce the potential for a circular reference, which could lead to an infinite loop.

  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Cycle

    The business rules behavior is to trigger the onchange you need the user to input.

    So it needs user input.

    [View:http://www.wipfli.com/BlogPost_MCRM_Blog_012715_BusinessRulesConflict.aspx]

    Hope that can help you.

    Thanks

  • Cyclefitness Profile Picture
    on at

    There does seem to be a defect with this, though.  My scenario is this:

    Fields 1 thru 3 on my form are within the control of JavaScript.  It's the JS to clear filtered lookups.

    Fields 4 thru 7 on the form are not impacted by the JavaScript.  They are all calculations via business rules.   The only way the calculations will work for 4 thru 7 is if the JavaScript functions on 1 thru 3 are turned off.  

    This just doesn't make sense.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans