Wednesday, January 21, 2009

Changing the default / availability of options for an account & contact lookup

This is copied from http://umarkhan.wordpress.com/2007/10/22/how-to-change-the-default-entity-in-lookup-window/  (just in case it is ever removed)

For instance, in Opportunity form of Microsoft CRM you want to change the “Potential Customer” field’s default entity from Account to Contact. You need to use the following piece of code in onLoad event of the Opportunity Form.

if ( crmForm.all.customerid != null )
{
    crmForm.all.customerid .setAttribute(”defaulttype”, “2″);
}

Remember to enable the event and then save and publish the opportunity entity.

Following are codes of basic entities of Microsoft CRM 3 ;

  • Account    1
  • Contact     2
  • Lead         4

Limiting the selection List can be done this way:

crmForm.all.customerid.setAttribute(”lookuptypes”, “1″);

Thanks heaps uMar.

No comments: