Create a button on the CRM 4.0

I'll show you the example of Appeal (Case-incident) how to create a button on the form and hang on click function.

ms-crm-create-button-alert

button on the CRM-form

Add to the essence of the new Case attribute named new_button, submit it to a form, the properties of the field new_button remove the check mark Display label on the form, save and publish.

Open the OnLoad event of form and paste the following script:

 
/* Jscript */



/ / The button
crmForm.all.new_button.DataValue = «Button»;
crmForm.all.new_button.style.textAlign = "center";
crmForm.all.new_button.vAlign = "Middle";
/ / styles
crmForm.all.new_button.style.cursor = "Hand";
crmForm.all.new_button.style . backgroundColor = "# CADFFC";
crmForm.all.new_button.style.color = "# 000000";
crmForm.all.new_button.style.borderColor = "# 330066";
crmForm.all.new_button.style.fontWeight = "bold ";
crmForm.all.new_button.contentEditable = false;
/ / change color when the mouse



changeC1 function () {
crmForm.all.new_button.style.color = "000099";
}
changeC2 function () {
crmForm.all.new_button.style.color = "000000";
}
changeC3 function () {
crmForm.all.new_button.style.backgroundColor = "# 6699FF";
}
changeC4 function () {
crmForm.all.new_button.style.backgroundColor = "CADFFC";
}
/ / when you click on the button call the TestTheButton
crmForm.all.new_button.attachEvent ("onclick", TestTheButton);
function TestTheButton ()
{Alert (":)");
}