Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

When you create an order, an invoice, or a quote from an opportunity, the customized fields in the order, the invoice, or the quote are not automatically populated with the default value in Microsoft Dynamics CRM 3.0


View products that this article applies to.

Symptoms

Consider the following scenario. You have customized fields on the following entities so that the fields contain a default value:
  • Order
  • Invoice
  • Quote
When you create an order, an invoice, or a quote from an opportunity, the customized fields in the order, the invoice, or the quote are not automatically populated with the default value in Microsoft Dynamics CRM 3.0.

For example, you customize a picklist field on the Order entity to use a default value. Then, you open an opportunity, and then you create a new order. When you open the new order, the picklist field does not contain the default value that you specified.

↑ Back to the top


Cause

This issue occurs because the form for the order, for the invoice, or for the quote is saved before the fields in the form are populated with the default values.

↑ Back to the top


Resolution

To resolve this issue, create an OnLoad event in the form for the order, for the invoice, or for the quote. To do this, follow these steps:
  1. Click Settings, click Customization, and then click Customize Entities.
  2. Use the appropriate method:
    • Click the Order entity, click More Actions, and then click Edit.
    • Click the Invoice entity, click More Actions, and then click Edit.
    • Click the Quote entity, click More Actions, and then click Edit.
  3. Click Forms and Views.
  4. Click the Form entity, click More Actions, and then click Edit.
  5. In the Common Tasks pane, click Form Properties.
  6. On the Events tab, click OnLoad in the Event List box, and then click Edit.
  7. Click to select the Event is enabled check box, and then add code that resembles one of the following code samples.

    Change the field names in the code sample to the names of the fields that are not populated with the default values.

    To populate a picklist field in the form, add code that resembles the following code sample.
    if(crmForm.all.new_testpl.DataValue==null)
    {
    //Add a line for each default picklist field that must be populated in the Order form
    crmForm.all.new_testpl.DataValue=2; //Sample picklist
    }
    
    To populate a boolean field in the form, add code that resembles the following code sample.
    if(crmForm.all.new_test.DataValue==null)
    {
    //Add a line for each default boolean field that must be populated in the Order form
    crmForm.all.new_test.DataValue=false; //Sample boolean
    }
    
  8. Click OK to close the Event Detail Properties dialog box.
  9. Click OK to close the Form Properties dialog box.
  10. Click Save and Close to close the "Form: Order" window, the "Form: Invoice" window, or the "Form: Quote" window.
  11. Click Save and Close to close the "Entity: Order" window, the "Entity: Invoice" window, or the "Entity: Quote" window.
  12. Publish the form customizations.
  13. Clear the Internet Cache folder and the Temporary Internet Files folder in Windows Internet Explorer. To do this, follow these steps:
    1. Click Start, click Control Panel, and then click Internet Options.
    2. On the General tab, click Delete under Browsing history.
    3. Under Temporary Internet Files, click Delete files.

↑ Back to the top


Keywords: KB935805, kbexpertiseinter, kbprb, kbmbsmigrate, kbtshoot, kbexpertisebeginner, kbmbscustomization

↑ Back to the top

Article Info
Article ID : 935805
Revision : 2
Created on : 8/15/2007
Published on : 8/15/2007
Exists online : False
Views : 251