Example of add button in CRM Form like

Set the following things.
Label of button (web resource).
function CompetitorLoad() {
convertWebResourceToButton('WebResource_btnCalculate', 'Calculate Implants', '150px', '0px', function () { window.location.reload(true); return false; });
}
function convertWebResourceToButton(fldName, btnLabel, btnWidth, leftMargin, evt) {
var btn = '<button id="btn_' + fldName + '" ' +
' style="margin-left:' + leftMargin + ';width:' + btnWidth + ';" ' +
' class="ms-crm-Button" ' +
' onmouseover="Mscrm.ButtonUtils.hoverOn(this);" ' +
' onmouseout="Mscrm.ButtonUtils.hoverOff(this);" '
+ '>' + btnLabel + '</button>';
var ctrl = Xrm.Page.ui.controls.get(fldName)._control.get_element().childNodes[1];
ctrl.innerHTML = btn;
$(ctrl.firstChild).bind('click', evt);
Set function to page load like

1. Double click on your section like below
image.
Set the following things.
Set web resource image.
Name of button (web resource).Label of button (web resource).
2. Create java-script function call on
Form load
function CompetitorLoad() {
}
}
Set function to page load like
No comments:
Post a Comment