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)

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

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    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

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

    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
    Shahbaaz Ansari Profile Picture
    6,211 on at

    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

  • Community Member Profile Picture
    on at

    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.

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