Hi,
We have a business requirement where we need to lock all the fields and controla on the form when Campaign status reason is Executing, Execution queued or complete.
We don't want to deactivate the record so we have written below method to lock all the controls on the form from javascript on form load.
function disableAllFormFields(context) {
var formContext = context.getFormContext();
formContext.ui.controls.forEach(function (control, i) {
if (control && control.getDisabled && !control.getDisabled()) {
control.setDisabled(true);
}
});
}
I am seeing weird behaviour where some of the fields are still not locked when Campaign status reason criteria is met.
I have already verified no business rules are present on the campaign form.
No other javascript code found which will enables those fields.
I tried adding this code/method using data.addOnLoad in form on load event but no help.
I tried adding delay with the help of setTimeout but that also did not fix the issue.
Reaching out to the community members to help me figure out this issue and provide guidance.