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

How to Trigger a Microsoft Flow from a Custom Button in Dynamics 365

  When using Microsoft Flow the out-of-the-box button is nested under the ‘Flow’ section and is not easy to find nor is it customizable. Tri...