Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unable to find show field values component in 365 Version

Posted on by 110

Hello,

I'm unable to find show field values component in business rule on MS Dynamics 365 version which is available on MS Dynamics 2016 version

Thank You 

T. Indra Kumar

*This post is locked for comments

  • Fubar Profile Picture
    Fubar 2,752 on at
    RE: Unable to find show field values component in 365 Version

    Alternatively you could also use linked lookups, where a value in the first lookup filters the second lookup.  If you have to use picklists rather than lookups then you will need to use JavaScript (in addition to the code snippets others have provided there is also an example in the SDK)

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Unable to find show field values component in 365 Version

    In addition to Francesco's response, you can also do the following:

    Add an OnChange event to the control that you want to add within the form User Interface:

    In the Form, click on the Control, select Change Properties on the Ribbon, click on the events tab and enter the name of the JavaScript Library and Function that you want to add the logic to.

    If you are using Dynamics 365 v8.2 or v9, you should start using the new client api, and pass the execution context as a parameter to your function:

    // Old Client API

    function picklistOnChange()

    {

       var fieldValue = Xrm.Page.getAttribute("new_picklistname").getValue();

       switch (fieldValue)

       {

           case 10:

           // Perform some action

           break;

           case 20:

           // Perform other action

           break;

           default:

           // Perform default action

           break;

       }

    }

    // New Client API

    function picklistOnChange(context)

    {

       var entityObject = context.getFormContext().data.entity;

       var fieldValue = entityObject.attributes.getByName("new_picklistname").getValue();

       // Add Same Switch Statement as in Old Client API function

    }

    If you need to change values of options sets you can use the following control methods:

    Xrm.Page.getControl("controlName").addOption( {value: 1, text: "Active" });

    Xrm.Page.getControl("controlName").removeOption(10);

    Xrm.Page.getControl("controlName").clearOptions();

    Take a look at the following articles for more info:

    neilparkhurst.com/.../javascript-control-optionset-values

    Hope this helps.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to find show field values component in 365 Version

    Hi Indra,

    a such functionality has never been released in Business action (hiding an option).

    You could reach your goal with javascript:

    function OnLoad()
    {
        Xrm.Page.getAttribute('new_myattribute').addOnChange(MyAttributeOnChange);
    }
    
    function MyAttributeOnChange()
    {
        var new_myattribute = Xrm.Page.getAttribute("new_myattribute").getValue();
        if (new_myattribute == VALUE_TO_CHECK)
            Xrm.Page.getControl('customertypecode').removeOption(3); // value of option
    }
    

    Please let me know if you solve

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Suggested answer
    Indra Tata Profile Picture
    Indra Tata 110 on at
    RE: Unable to find show field values component in 365 Version

    Thank you Iswarya for your valuable suggestion. But my question is not exactly what you answered. My question is, I want to set field values (like when is select one value in option set filed i should be able to set visible options in that option set). Using set Visibility we can set the entire field show/hide but not the options in optionset field

  • Suggested answer
    Iswarya Profile Picture
    Iswarya 1,345 on at
    RE: Unable to find show field values component in 365 Version

    Hi,

    you can use SetVisibility instead of ShowField

    86204.Untitled.png

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans