Please wait, loading...

 

How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013 dynamics365

December 18, 2017
How to Create Dynamic OptionSet in MS Dynamics CRM 2011 & 2013

This code will help you………………
function dynamicoptionset() {

//get value in no in variable
    var totaldivision = Xrm.Page.getAttribute(“fieldname” ).getValue();
    if (totaldivision == null || totaldivision == “” )
        return;
    else {
        var optionsetControl = Xrm.Page.ui.controls.get( “new_division” );
        var options = optionsetControl.getAttribute().getOptions();

        optionsetControl.clearOptions();
        for ( var i = 0; i < totaldivision; i++) {

            optionsetControl.addOption(options[i]);
        }
    }
}


SOURCE : mscrm.com

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more