Please wait, loading...

 

SET THE FIELD REQUIRED / MANDATORY USING JAVASCRIPT IN MSCRM 2011 , 2013

February 14, 2014
function eventtypechange()
{
var m =Xrm.Page.getAttribute(“typecode”).getValue();
if(m==3)
{
Xrm.Page.getAttribute(“msa_street1”).setRequiredLevel(“required”);
Xrm.Page.getAttribute(“msa_stateprovince”).setRequiredLevel(“required”);
Xrm.Page.getAttribute(“msa_city”).setRequiredLevel(“required”);
Xrm.Page.getAttribute(“msa_zippostalcode”).setRequiredLevel(“required”);

}
else
{
Xrm.Page.getAttribute(“msa_street1”).setRequiredLevel(“none”);
Xrm.Page.getAttribute(“msa_stateprovince”).setRequiredLevel(“none”);
Xrm.Page.getAttribute(“msa_city”).setRequiredLevel(“none”);
Xrm.Page.getAttribute(“msa_zippostalcode”).setRequiredLevel(“none”);
}
}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651&ssl=1
Microsoft Dynamics Community Profile

Learn more