Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hiding drop down value with business rule

(0) ShareShare
ReportReport
Posted on by 144

Hi,

I know that it is possible to hide fields on forms based on certain value.

Is there possibility to show/hide dropdown values inside one field with business rules?

Thanks in advance 

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: Hiding drop down value with business rule

    Hiding was the all drop down values that was according to the business rule on this I have some question regard this. I need to get answer so I wrote them all according to the grademiners so I can get all answer of the subjects I have in my mind.

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at
    RE: Hiding drop down value with business rule

    Hi Davor,

    It is not possible with business rule, but you can achieve this by using javscript code.

    If you want to hide optionset on some other field let say fieldX, then write a javascript code on Onchange event of FieldX,

    Please check this link for the code,

    vasubabumscrm.blogspot.com.au/.../addremove-optionset-value-at-run-time.html

    Hope this helps,

    Best Regards,

    Shahbaaz

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Hiding drop down value with business rule

    Hi ,

    You need to write simple javascript to add or remove options from optionset field  as per your business logic.

    Here is sample code-

    function OnloadOptionSet() {

       var optionSet = Xrm.Page.ui.controls.get("new_myoptionset");

       var optionSetValues = optionSet.getAttribute().getOptions();

       optionSet.clearOptions();

       optionSetValues.forEach(function (element) {

           if (element.value == "831260009" || element.value == "831260008")

               optionSet.addOption(element);

           if (element.value == "831260008" || element.value == "831260008")

               optionSet.addOption(element);

       });

    }

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Hiding drop down value with business rule

    Hello,

    you can't do this using business rules, you have to write java script for this. You can refer sample here: http://crmdynamicblog.blogspot.com.au/2012/06/remove-item-from-picklist.html

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans