Microsoft KB Archive/935805

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

Article ID: 935805

Article Last Modified on 8/15/2007

-

APPLIES TO


 * Microsoft Dynamics CRM 3.0

-



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.



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.



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:  Click Settings, click Customization, and then click Customize Entities. 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.  Click Forms and Views.</li> Click the Form entity, click More Actions, and then click Edit.</li> In the Common Tasks pane, click Form Properties.</li> On the Events tab, click OnLoad in the Event List box, and then click Edit.</li>  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 } </li> Click OK to close the Event Detail Properties dialog box.</li> Click OK to close the Form Properties dialog box.</li> Click Save and Close to close the &quot;Form: Order&quot; window, the &quot;Form: Invoice&quot; window, or the &quot;Form: Quote&quot; window.</li> Click Save and Close to close the &quot;Entity: Order&quot; window, the &quot;Entity: Invoice&quot; window, or the &quot;Entity: Quote&quot; window.</li> Publish the form customizations.</li> Clear the Internet Cache folder and the Temporary Internet Files folder in Windows Internet Explorer. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Start, click Control Panel, and then click Internet Options.</li> On the General tab, click Delete under Browsing history.</li> Under Temporary Internet Files, click Delete files.</li></ol> </li></ol>

Additional query words: crm3 crm30 crm3.0 default picklist boolean

Keywords: kbmbscustomization kbexpertisebeginner kbtshoot kbmbsmigrate kbprb kbexpertiseinter KB935805

-

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

© Microsoft Corporation. All rights reserved.