Friday, October 18, 2024

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

 In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript


label1 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870000);
    label2 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870001);
    label3 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870002);
    label4 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870003);
    label5 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870004);
    label6 = formContext.getAttribute("bosch_optionsetvalues").getOption(377870005);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870000);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870001);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870002);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870003);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870004);
    formContext.getControl("bosch_optionsetvalues").removeOption(377870005);


        formContext.getControl("bosch_optionsetvalues").addOption(label1);
        formContext.getControl("bosch_optionsetvalues").addOption(label2);
        formContext.getControl("bosch_optionsetvalues").addOption(label3);


Monday, October 7, 2024

Day 10 - Using JavaScript to Set Field Requirements Dynamically - JavaScript in MSCRM/Dataverse

 In this Blog, we will see how to Set Field Requirements Dynamically - JavaScript in MSCRM/Dataverse



if (formContext.getAttribute("bosch_booleanfield").getValue() == true) {
        formContext.getAttribute("bosch_enabledisablefield").setRequiredLevel("none");
    }
    else if (formContext.getAttribute("bosch_booleanfield").getValue() == false) {
        formContext.getAttribute("bosch_enabledisablefield").setRequiredLevel("required");
   }

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...