Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Hide & Show Field for Select Option Set Values

Posted on by

Hi All,

I Have a Custom entity,in this entity we have many field,Some fields are only show on selected Option set Value.How to do..plz help

*This post is locked for comments

  • Suggested answer
    Prudvihub Profile Picture
    Prudvihub 65 on at
    RE: Hide & Show Field for Select Option Set Values

    Take a look into below post

    prudvihub.blogspot.com/.../show-and-hide-fields-in-microsoft-crm.html

  • Saddamk206 Profile Picture
    Saddamk206 777 on at
    RE: Hide & Show Field for Select Option Set Values

    Hi,

    Also can try this:-

    for (var i = 0; i < Xrm.Page.getAttribute("FieldName").getOptions().length; i++)
    {

    Xrm.Page.getControl("FieldName").removeOption(Xrm.Page.getAttribute("FieldName").getOptions()[i].value);
    }

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide & Show Field for Select Option Set Values

    aspsolutionkirit.blogspot.in/.../hideshow-field-based-on-option-set-in.html

  • Suresh Sorde Profile Picture
    Suresh Sorde 1,075 on at
    RE: Hide & Show Field for Select Option Set Values

    You can use javascript to show/hide fields or sections. If you have two option values then create two sections put your field as per option that you want to show in one section and hidden fields in another section. Then write javascript to show hide section as per options values.

    Hope this helps.

    Thanks

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Hide & Show Field for Select Option Set Values

    Business rules are easy to work upon in this scenario compared to Javascript. They prevent usage of complex Javascript codes.

    http://suyati.com/understanding-business-rules-in-ms-dynamics-crm/

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Hide & Show Field for Select Option Set Values

    Hi

    Create a javascript function to hide controls based on the optionset value and configure those function in then on change event of optionset field.

    Example:

    var objOptionInstance=Xrm.Page.getAttribute("provide fieldSchemaName here");

    //option set text name

    if(obj.getText()=='option set text name')

    Xrm.Page.getControl('field name ').setVisible(bool);

    //Option set value

    if(obj.getValue()=='option set number')

    Xrm.Page.getControl('field name ').setVisible(bool);

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide & Show Field for Select Option Set Values

    Hi DineshRaja,

    Write java script to show/hide the form field when you are changing the Option set value on the same form.

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Hide & Show Field for Select Option Set Values

    Hi Dinesh Raja,

    You could write a business rule to achieve the same. Please refer the links below.

    heidster12.wordpress.com/.../showhide-fields-with-business-rules/

    community.dynamics.com/.../hiding-a-section-and-fields-in-microsoft-dynamics-crm-2013-using-business-rules

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans