IN case you want to add Custom |HTML following example will help, suppose you wanna create custom button on form then create a multilinetext field add it to form and remember that field schemaname
Now open form properties.
Create a javascript resource file with following code. new_validationbutton is your field name. ctrl.innerHTML=btn is actually replacing ctrl.innerHTML with button HTML code.
Check following example code....
function contactsOnLoad(){
convertWebResourceToButton('new_validatebutton', 'Build Condition', '150px', '3px');
}
function convertWebResourceToButton(fldName, btnLabel, btnWidth, leftMargin){
var btn = '<button id="btn_' + fldName + '" ' +
' style="margin-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[0];
// Replace controlewith buttom
ctrl.innerHTML = btn;
// Add Event to the newly created button
ctrl.firstChild.attachEvent('onclick', ShowModal);
return false;
}
Thanks Regards Prashanth Kamasamudram Even the least work done for others awakens the power within; even thinking the least good of others gradually instills into the heart the strength of a lion.