Recently I had a customer who needed to set the requirement level based on a certain field combination.
The web is full of examples of how to do this. The way i prefere is the way Ronald does it.
// Set field to not required crmForm.SetFieldReqLevel("fieldname", 0); // Set field to business required crmForm.SetFieldReqLevel("fieldname", 1); // Set field to business recommended crmForm.SetFieldReqLevel("fieldname", 2);
For some reason he also specified a alternative way of doing it. I'm not sure why this should be smarter. Enlighten me if you like :-)
// set the field required (i.e. show error message when field is not filled in) crmForm.all.fieldname.req = 2; // modify the label to be red crmForm.all.fieldname_c.className = 'req';
Credits of course goes to Ronald :-)
http://ronaldlemmen.blogspot.com/2007/07/change-requirement-level-at-runtime.html
Signing out
Peter Toftager-Larsen