Disable all fields on the form
When you need to prevent user changes for the form but cannot set the record to Deactivated
Javascript code on load:
function disableAllFields (executionContext) {
var formContext = executionContext.getFormContext();
var formControls = formContext.ui.controls;
formControls.forEach(control => {
if (control.getName() != "" && control.getName() != null) {
control.setDisabled(true);
}
});
}
Interested to learn more ?
Im gonna be honest - Dynamics 365 is one of those tools that is an incredibly powerful platform for your organization. With that power, comes a certain level of complexity. If you’d like to get some real answers about how Dynamics can benefit your organization, give me a call for a quick chat to see if it’s an option for you.
Give us a call at 604.846.4402 or email info@dominicsystems.com
Applies to:
Dynamics 365 On-Prem
Dynamics 365 On-line
Power Platform
Related Content: