Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Business rule to auto-fill field and dependent option set picklist field

Posted on by Microsoft Employee

Hi,

I made a geo region field and dependent option set (picklist) for geo sub-regions. Both option sets. I tested it and it worked fine. Using this:

https://msdn.microsoft.com/en-us/library/gg594433.aspx

When I added  a business rule to auto-fill the geo region based on the province field from the address, it fills in my geo region with the value I set from the option set, but it doesn't trigger the geo sub-region picklist to populate.

If I manually click on the geo region it triggers the sub-region list, but that defeats the purpose of the auto-fill rule.

Is there a way to trigger the sub-region list once the business rule applies?

Or do I have to scrap the idea of auto-filling the geo region field and get users to manually select it so the correct picklist applies? It will be redundant clicking for users.

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Business rule to auto-fill field and dependent option set picklist field

    Thanks Drew, it worked when I set 1 region in the field attribute where "123" was. I have several regions, how can I write the function so that it will trigger for each region?

    I don't know javascript, should I use an IF THEN fireOnChange function multiple times for each? or is there a way to write IF (region1 OR region2 OR region3 ) THEN fireOnChange

    What should the code look like?

    eg. region1, region2, region3

    This is the original code:

    function businessrule_trigger_js() {

    Xrm.Page.getAttribute("Field_B").setValue("region1");

    Xrm.Page.getAttribute("Field_B").fireOnChange();

    }

    Thanks

  • Verified answer
    Drew Poggemann Profile Picture
    Drew Poggemann 9,079 on at
    RE: Business rule to auto-fill field and dependent option set picklist field

    Hi Cynthia, I think the following article discusses the same problem you are having.  In the notes you will see the same issue occurs in 2016 as well.  Hope this helps to fix the issue.

    www.wipfli.com/BlogPost_MCRM_Blog_012715_BusinessRulesConflict.aspx

    Thanks,

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans