Hi, You can put the following code in Onsave() event(from sdk).
You can modify it according to your requirment, e.g. to check whether the bit field is true
if(crmForm.all.SOME_BOOLEAN_FIELD_ID.DataValue)
{
// Boolean field is true.
}
Example
The following code shows how to validate the job title field when the
Save button is clicked and to provide a default job title when the
Save and Close button is clicked.
var CRM_FORM_SAVE_MODE_SAVE = 1;
var CRM_FORM_SAVE_MODE_SAVEANDCLOSE = 2;
// Validate only if the user clicked "Save".
switch (event.Mode)
{
case CRM_FORM_SAVE_MODE_SAVE:
// If the user provided a first and last name, they must provide
// a job title also.
if (crmForm.all.jobtitle.DataValue == null &&
crmForm.all.firstname.DataValue != null &&
crmForm.all.lastname.DataValue != null &&)
{
// Tell the user what is wrong.
alert("Please provide a Job Title for this person.");
// Give the control focus.
crmForm.all.jobtitle.SetFocus();
// Cancel the save operation.
event.returnValue = false;
return false;
}
break;
case CRM_FORM_SAVE_MODE_SAVEANDCLOSE:
// If the user forgot to provide a job title, set a default title.
if (crmForm.all.jobtitle.DataValue == null)
{
// Set a default Job Title.
crmForm.all.jobtitle.DataValue = "N/A";
// Because this is a "Save and Close",
// just save the form.
return true;
}
break;
}
Muhammad Ali Khan
http://malikhan.wordpress.com