Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Conditional warning using Jscript

$
0
0

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);
}}
}

Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>