Hello,
I am by no means an expert at this but have been trying for hours and cant get this to work. I have it to trigger onload on the form and below is my jscript. I kept getting the unidentified error yet the field value is correct. This is a two option field. with Yes value = 1 and No = 0.
function lockwarning(executionContext){ var warningvar = "warning"; var formContext = executionContext.getFormContext(); { var lockphase = formContext.getAttribute("new_lockphase").getValue(); if (lockphase === 1){ Xrm.Page.ui.setFormNotification ("Phase locked Contacted Management","WARNING",warningvar); } if (lockphase === 0){ formContext.ui.clearFormNotification(warninvar); }} }