Article ID: 949941 - Last Review: November 6, 2009 - Revision: 3.0

The fields that have an OnChange event enabled are unavailable in the Edit Multiple Records window in Microsoft Dynamics CRM 4.0

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
Expand all | Collapse all

SYMPTOMS

When you edit multiple records in the Edit Multiple Records window in Microsoft Dynamics CRM 4.0, the fields that have the OnChange event enabled are unavailable. Also, any custom OnLoad events or OnSave events for the form are disabled.

CAUSE

This problem occurs because Microsoft Dynamics CRM 4.0 disables the fields that have the OnChange event enabled in the Edit Multiple Records window. Microsoft Dynamics CRM 4.0 disables these fields to prevent the OnChange event from causing errors.

WORKAROUND

To work around this problem, manually enable the fields that have the OnChange event enabled. For example, to manually enable the parentaccountid field, follow these steps:
  1. Export the customizations of the account. To do this, follow these steps:
    1. In Microsoft Dynamics CRM 4.0, click Settings, click Customization, and then click Export Customizations.
    2. Click Account, click More Actions, and then click Export Selected Customizations on the toolbar.
    3. Click OK, and then save the exported file as the AccountCustom.xml file.
  2. In Notepad, open the AccountCustom.xml file, and then locate the following section:
    label description="Parent Account"
  3. In this section of the AccountCustom.xml file, locate the following line of code.
    <event name="setadditionalparams" application="true" active="true">
  4. Change the existing line of code as follows.
    <event name="setadditionalparams" application="true" active="true" BehaviorInBulkEditForm="EnabledButNoRender">
    
  5. Next, locate the following line of code.
    <event name="onchange" application="false" active="true">
  6. Change the existing line of code as follows.
    <event name="onchange" application="false" active="true" BehaviorInBulkEditForm="EnableButNoRender">
  7. Save the changed AccountCustom.xml file.
  8. Import the changed AccountCustom.xml file. To do this, follow these steps:
    1. Click Settings, click Customization, and then click Import.
    2. Click the changed AccountCustom.xml file, and then click Upload.
    3. Click Account, click More Actions, and then click Import Selected Customizations.
  9. Publish the customizations. To do this, follow these steps:
    1. Click Settings, click Customization, and then click Customize Entities.
    2. Click Account, and then click Publish on the toolbar.
  10. Open a bulk edit form for Account1 and for Account2.
  11. Click the Parent Account lookup button.

    You may see the following events.
    <events>
    <event name="setadditionalparams" application="true" active="true" BehaviorInBulkEditForm="EnabledButNoRender">
    <script><![CDATA[
    var oLookup = event.srcElement;
    var sAccountId = crmFormSubmit.crmFormSubmitId.value;
    if (sAccountId != "") /* parent account is being updated, filter out this account */
    {
    oLookup.lookupclass="ParentLookup";
    oLookup.AddParam("currentaccount", sAccountId);
    }
    ]]></script>
    </event>
    </events>
    
You can follow these steps for the ParentCustomerID field on the Contact entity or for any field that has events. The valid values for these fields are as follows:
  • Enabled
    If you use this value, the field is enabled. Additionally, the code for the event is run when the event is called.
  • Disabled
    If you use this value, the field is disabled.
  • EnabledButNoRender
    If you use this value, the field is enabled. However, the code for the event is not run when the event is called.

MORE INFORMATION

For the ParentAccount field and for the ParentCustomerID field, the events that are run prevent the lookup form from displaying the selected account. Even though the parameter is set to the Enabled value, the fields do not filter the bulk selected accounts. However, if you try to set the parent account of the bulk selected accounts to itself, you receive a vague error message when you set the parent account. Therefore, the circular reference from an account cannot be its own parent account.

To enable the OnLoad and OnSave events in the Bulk Edit Form search for the following lines of code:
<event name="onload" application="false" active="true">
<event name="onsave" application="false" active="true">


Edit the existing lines of code as follows:
<event name="onload" application="false" active="true" BehaviorInBulkEditForm="EnableButNoRender">
<event name="onsave" application="false" active="true" BehaviorInBulkEditForm="EnableButNoRender">

APPLIES TO
  • Microsoft Dynamics CRM 4.0
Keywords: 
kbmbscustomization kbexpertisebeginner kbtshoot kbmbsmigrate kbprb kbexpertiseinter KB949941