Good day
Please could you help with the below error i keep getting:
I have the following function set up:
function CanUserUpdateField(executionContext, field) {
var formContext = executionContext.getFormContext();
if (formContext.getAttribute(field).getUserPrivilege().canUpdate && formContext.getAttribute(field).getIsDirty()) {
formContext.getAttribute(field).setSubmitMode("always");
} else {
formContext.getAttribute(field).setSubmitMode("never");
}
}
I keep getting the below error:
TypeError: executionContext.getFormContext is not a function
at CanUserUpdateField
please can someone advise what i am doing wrong or if there is something I am missing.
Thanks