Microsoft KB Archive/920959

= 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 =

Article ID: 920959

Article Last Modified on 8/28/2006

-

APPLIES TO


 * Microsoft Dynamics CRM 3.0

-





SYMPTOMS
Consider 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.



RESOLUTION
To 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.</li> On the Events tab, click OnLoad and then click Edit.</li>  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; </li> Click OK to close the Event OnLoad Properties dialog box.</li> Click OK to close the Form Properties dialog box.</li> Click Save and Close to close the Form: Contact dialog box.</li> On the Actions menu, click Publish.</li> Click Save and Close.</li> Repeat step 4 through step 14 to customize the Account entity. Do the same to customize the Opportunity entity.</li></ol>

Additional query words: crm3 crm30 crm3.0

Keywords: kbmbscustomization kbprogramming kbtshoot kbmbsmigrate kbprb KB920959

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.