Friday, March 12, 2010

Button on CRM form in MS CRM 4.0

There is a workaround of creating a button on the CRM form.
The logic behind is , just place a text box attribute on the CRM form, hide the label/textbox of the corresponding attribute and make the textbox/label (other half) of the same attribute to a button.

Here we have an attribute name new_button (textbox). The first half(label) has been made hidden always and second half of the attribute (textbox) has been converted to a button. And the event has been added to the button.

Example:
crmForm.all.new_ button_c.style.display = 'none'
crmForm.all.new_button_d.innerHTML = "<button class='ms-crm-Button' onclick='ButtonClick();'>Click Here</button>";

ButtonClick = function() {
// write your logic here..

}

No comments: