Friday, 17 March 2017

CRM 4.0 JScript Guide

// CRM 4.0 Form Scripts Example
//Set Field Value
crmForm.all.crmfieldscemaname.DataValue= "value";

//Get Field Value
var value = crmForm.all.crmfieldscemaname.DataValue;

//Set Requirement Field
crmForm.all.crmfieldscemaname.setAttribute( "req",0);
//or
crmForm.all.crmfieldscemaname_c.classname= "n";

// Set Recommended
crmForm.all.crmfieldscemaname.setAttribute( "req",1);
//or
crmForm.all.crmfieldscemaname_c.className= "rec";

//Set Required
crmForm.all.crmfieldscemaname.setAttribute( "req",2);
//or
crmForm.all.crmfieldscemaname_c.className= "req";

//Disable a field
crmForm.all.crmfieldscemaname.Disabled= true;

//Enable a Field
crmForm.all.crmfieldscemaname.Disabled= false;

//hide a field
crmForm.all.crmfieldscemaname.style.Display= "none";
//or
crmForm.all.crmfieldscemaname_c.style.Display= "none";

//Show a field
crmForm.all.crmfieldscemaname.style.Display= "block";
//or
crmForm.all.crmfieldscemaname_c.style.Display= "inline";

//Set PickList Value
crmForm.all.crmfieldscemaname.DataValue= "none";

//Get PickList Value
var value=crmForm.all.crmfieldscemaname.DataValue;

No comments :

Post a Comment