Microsoft Knowledge Base Email Alertz

(920959) - Describes an issue that occurs when you customize the Contact form, the Account form, or the Opportunity form to provide default values for Boolean attributes or for picklist attributes. Provides steps to resolve the issue.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 920959 - Last Review: August 28, 2006 - Revision: 1.4

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

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:
  1. Log on to the Web application of Microsoft Dynamics CRM 3.0.
  2. Click Settings, and then click Customization.
  3. Click Customize Entities.
  4. Double-click the entity that you want to customize. For example, double-click Contact.
  5. Click Forms and Views.
  6. Double-click Form. This is the main application form.
  7. Under Common Tasks, click Form Properties.
  8. On the Events tab, click OnLoad and then click Edit.
  9. 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(); 
    
  10. Click OK to close the Event OnLoad Properties dialog box.
  11. Click OK to close the Form Properties dialog box.
  12. Click Save and Close to close the Form: Contact dialog box.
  13. On the Actions menu, click Publish.
  14. Click Save and Close.
  15. Repeat step 4 through step 14 to customize the Account entity. Do the same to customize the Opportunity entity.

APPLIES TO
  • Microsoft Dynamics CRM 3.0
Keywords: 
kbmbscrm40no kbmbscustomization kbprogramming kbtshoot kbmbsmigrate kbprb KB920959
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate