Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

JavaScript - Hide/Show Multiselect option set based on another option set

$
0
0

I have JavaScript in place which creates a Multiselect option set based on code from here:

http://taoofcrm.com/2011/05/16/multi-select-option-sets/

I am trying to now hide/show this multiselect option set (on the right) based on a selection from another option set (left):

  I cannot get it to work properly.  Here is my hide/show code:

// Policy Activity entity Main Library

function Form_onload() {

    var participationOthersEventsControl = Xrm.Page.getControl("me_ipasparticipationinothersevents");
    var participationOthersValueControl = Xrm.Page.getControl("me_participationothersevents_value");

    participationOthersEventsControl.setVisible(false);

function policyActivityType_onchange() {

    var policyActivityTypeControl = Xrm.Page.getControl("me_policyactivitytype");
    var policyActivityTypeAttribute = Xrm.Page.getAttribute("me_policyactivitytype");
    var policyActivityType = policyActivityTypeAttribute.getValue("me_policyactivitytype");

    var participationOthersEventsControl = Xrm.Page.getControl("me_ipasparticipationinothersevents");
    var participationOthersValueControl = Xrm.Page.getControl("me_participationothersevents_value");

    if (policyActivityType == 134320005) {
        participationOthersEventsControl.setVisible(true);
    } else {
        participationOthersEventsControl.setVisible(false);
    }

}
Thanks for your help!




Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>