The default values for Boolean attributes or for picklist attributes are not used when you convert a lead to a contact, to an account, or to an opportunity in Microsoft Dynamics CRM 3.0 (920959)
The information in this article applies to:
SYMPTOMSConsider the following scenario in Microsoft Dynamics CRM 3.0. You customize the Contact form to provide default values for Boolean attributes or for picklist attributes when you create a new contact. Then, you convert a lead to a contact. In this scenario, the default values are not used when the contact is created.
Note This issue also applies to the Account form and to the Opportunity form when you convert a lead to an account or to an opportunity.RESOLUTIONTo resolve this issue, customize the OnLoad event of the Contact form, of the Account form, and of the Opportunity form to retain the default values when a lead is converted. To do this, follow these steps: - Log on to the Web application of Microsoft Dynamics CRM 3.0.
- Click Settings, and then click Customization.
- Click Customize Entities.
- Double-click the entity that you want to customize. For example, double-click Contact.
- Click Forms and Views.
- Double-click Form. This is the main application form.
- Under Common Tasks, click Form Properties.
- On the Events tab, click OnLoad and then click Edit.
- On the Details tab, click to select the Event is enabled check box and then type the appropriate code.
For example, if the new_defaultvalue attribute is a picklist attribute for which you want the default value to be the second element of the picklist, type the following code.
var oField = crmForm.all.new_defaultvalue;
// If no picklist item is selected on Form Load
if(oField.DataValue==null)
{
// Set the picklist element to be the second element in the list.
oField.DataValue=2;
}
crmForm.Save();
If the new_defaultvalue attribute is a Boolean attribute for which you want the default value to be No, type the following code.
var oField = crmForm.all.new_defaultvalue;
// If there is no picklist item selected on Form Load
if(oField.DataValue==null)
{
// Set the picklist element to be the second element in the list.
oField.DataValue=false;
}
crmForm.Save();
- Click OK to close the Event OnLoad Properties dialog box.
- Click OK to close the Form Properties dialog box.
- Click Save and Close to close the Form: Contact dialog box.
- On the Actions menu, click Publish.
- Click Save and Close.
- Repeat step 4 through step 14 to customize the Account entity. Do the same to customize the Opportunity entity.
Modification Type: | Minor | Last Reviewed: | 8/28/2006 |
---|
Keywords: | kbMBScustomization kbProgramming kbtshoot kbMBSMigrate kbprb KB920959 kbAudEndUser |
---|
|