Ramblings about MS Dynamics CRM 2011 and coding basics.

Wednesday, January 23, 2008

Auto-fill Opportunity's topic attribute

This might seem really simple, but sometimes it is really useful.

A lot of people don't know what to write in the TOPIC field of an opportunity record. If you don't write something, then the record appears to be unnamed to the user.

You can auto-fill the topic several ways:
1. You can have all Opportunities have a default name:
//OnLoad Code
if (crmForm.all.name.DataValue==null)
{
crmForm.all.name.DataValue="Opportunity";
}

2. You can set the CustomerID name into the TOPIC field:
//This will name the Opportunity after the client.
//OnChange for the CustomerID attribute
crmForm.all.name.DataValue = crmForm.all.customerid.DataValue[0].name;

Labels: , , , , , , , , , , , ,

0 Comments:

Post a Comment

<< Home