We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

 
One can customize a Microsoft CRM form using javascript with lots of ease.  
  •     Navigate to Go To ->Settings ->Customization
  •     Select Customization Entities
  •     Double Click on the entity that is needed for customization.
  •    Click on Forms and Views and then double click on Form
  •    Select Form Properties from Common Task panel.
  •  It will open up the Form Properties dialog box with OnLoad and OnSave events.
  •    Select any event and click on edit. 
It will open up the event detail properties dialog box where one can enter the java script for customization. The code will be called when the event is triggered.
 
Following are few examples of customizing the Account form at Page Load
Change the Fore color of Label:
// it will change the Account Number Label to green bold
crmForm.all.accountnumber_c.innerHTML = "<font color='green'><b>" + crmForm.all.accountnumber_c.innerText + "</b></font>";
 
Change the background color of the form
document.all.tab0.style.backgroundColor = 'white';//General tab
document.all.tab1.style.backgroundColor = 'white';//Details tab
document.all.tab2.style.backgroundColor = 'white';//Administration tab
document.all.tab3.style.backgroundColor = 'white'; //Notes tab
 
Disable a form
document.body.disabled = true;
 
Hide an entire row
var accountname = crmForm.all.name;
while ((accountname.parentNode != null) && (accountname.tagName.toLowerCase() != "tr"))
{
   accountname = accountname.parentNode;
}
if (accountname.tagName.toLowerCase () == "tr")
{
   accountname.style.display = "none";
}
 
Retrieving the text of a lookup control
var list = crmForm.all.<lookupfield>.DataValue;
if (list [0] != null)
{
    var theSelectedText = list [0].name;
 }
 


Related Tags:

MS CRM

Author: Pradip Shukla

top

Miscellaneous

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login