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.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


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.

    The following events may be shown.
    <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>
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.

↑ Back to the top


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.

This functionality is only available to the OnChange events.  OnLoad and OnSave events will not trigger and this is functioning as designed.

↑ Back to the top


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

↑ Back to the top

Article Info
Article ID : 949941
Revision : 1
Created on : 1/7/2017
Published on : 8/3/2012
Exists online : False
Views : 382