Tuesday 13 June 2023

Disable all fields using JavaScript - Dynamics 365 code

      disableformFields(executionContext);



function disableformFields(executionContext) {

    var formContext = executionContext.getFormContext();

    var formControls = formContext.ui.controls;

    formControls.forEach(control => {

        if (control.getName() != "" && control.getName() != null) {

            control.setDisabled(true);

        }

    });

No comments:

Post a Comment

Git Basic working