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)

Adding a Business Rule to an OnChange event on a field

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I'm very new to Dynamics 365 and I'm trying to customize a form based on a custom entity I have created.

I have created a business rule that basically checks to see if a specific value is selected from a drop down and if it does then it sets the visibility of a field to be true and also makes it a required field.

The business rule validates but the issue I have is that it doesn't get triggered and I'm assuming that's because I need to add an onchange event. Form what I can gather I have to add a library to a form first or write some sort of javacript? 

I'm not too familiar with javascript and I sort of thought that this type of functionality would be out of the box.

Can someone help me or direct me to some "idiots" guide that would provide the instructions I need?

Debra 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Make sure you have activated the business rules  and do publish all customization then reload the page. You can take a look how to create Business Rules . For your requirement  you dont  need to write JavaScript.

    docs.microsoft.com/.../create-business-rules-recommendations-apply-logic-form

    www.magnetismsolutions.com/.../how-to-create-business-rules-in-dynamics-365

    https://www.youtube.com/watch?v=yKD-3cv76Uw

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    What do you mean by "The business rule validates but the issue I have is that it doesn't get triggered ". In addition to above, also ensure that all the field sincluded in the business rule are on the form. If any of the used fields are not on the form then BR will not trigger.

    Hope this helps.

  • Deb3107 Profile Picture
    2 on at

    Hi,

    I've tried absolutely everything. All fields in the business rule are on the forms. I've published all customizations.

    Does it make any difference where you create the business rule as I created it whilst in the form editor but then activated it via the solution explorer?

    Debra

  • Deb3107 Profile Picture
    2 on at

    When i created the business rule and saved it was validated. But if I run the form in preview mode and select the value that should trigger the business rule nothing happens. Do i need to add a web resource or onchange event?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    No matter from where you have created , you can create business rules from solution / customization area and also from form editor . Just make sure you do publish the forms and activated the business rules.

    Just to make sure view the forms and click on form editor , from  the form editor go to business rules , see you can see the rules or not.

    Once you validate the business rules you need to activated the rules , did you activate or not ?

  • Deb3107 Profile Picture
    2 on at

    Hi,

    I've tried all of the above. The image below shows the activated business rule.

    7536.Form.png

    This image shows that is is included in the form

    7536.Form.png

  • gdas Profile Picture
    50,091 Moderator on at

    Can you please share screenshot of business rules.

  • Verified answer
    Deb3107 Profile Picture
    2 on at

    I was being stupid! They don't work in Preview but they do work when you got to add a record etc

    I said I was new to this and obviously have a lot to learn.

    Thanks for your help though.

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