Questa funzione ci permette di settare dinamicamente nel crm se un campo lo vogliamo "business required" or "optional".
Create the function as below for crm3.0;
--------------------------------------------------
function crmForm.SetRequiredLevel(field, level)
{
field.req = level;
var fieldLabel = document.getElementById(field.id + "_c");
if (fieldLabel != null)
{
switch (level)
{
case 0: //normal
fieldLabel.className = "n";
break;
case 1: //recommended
fieldLabel.className = "rec";
break;
case 2: //required
fieldLabel.className = "req";
break;
}
}
}
--------------------------------------------------
Then call it using your field reference and the requirement level as needed.
--------------------------------------------------
crmForm.SetRequiredLevel(crmForm.all.fieldname, 2);