Skip to main content

Notifications

Day 5 - Show and Hide fields Based on Condition using JavaScript in MSCRM/Datave

Introduction:

In this blog we will see how to Show and Hide Fields based on Condition using JavaScript in MSCRM/ Dataverse


Script:

function showHideFieldsBasedonCondition(executionContext) {
    var formContext = executionContext.getFormContext();

    if (formContext.getAttribute("bosch_booleanfield").getValue() == true) {
        formContext.getControl("bosch_showorhidefield").setVisible(true);
    }
    else if (formContext.getAttribute("bosch_booleanfield").getValue() == false) {
        formContext.getControl("bosch_showorhidefield").setVisible(false);
    }
}


Trigger above code on ONCHANGE.


Attaching my video here for Detail

Comments