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
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.
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.
- 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.
APPLIES TO
- Microsoft Dynamics CRM 3.0
| 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