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.
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.
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:
- Export the customizations of the account. To do this, follow these steps:
- In Microsoft Dynamics CRM 4.0, click Settings, click Customization, and then click Export Customizations.
- Click Account, click More Actions, and then click Export Selected Customizations on the toolbar.
- Click OK, and then save the exported file as the AccountCustom.xml file.
- In Notepad, open the AccountCustom.xml file, and then locate the following section:
label description="Parent Account"
- In this section of the AccountCustom.xml file, locate the following line of code.
<event name="setadditionalparams" application="true" active="true">
- Change the existing line of code as follows.
<event name="setadditionalparams" application="true" active="true" BehaviorInBulkEditForm="EnabledButNoRender">
- Next, locate the following line of code.
<event name="onchange" application="false" active="true">
- Change the existing line of code as follows.
<event name="onchange" application="false" active="true" BehaviorInBulkEditForm="EnableButNoRender">
- Save the changed AccountCustom.xml file.
- Import the changed AccountCustom.xml file. To do this, follow these steps:
- Click Settings, click Customization, and then click Import.
- Click the changed AccountCustom.xml file, and then click Upload.
- Click Account, click More Actions, and then click Import Selected Customizations.
- Publish the customizations. To do this, follow these steps:
- Click Settings, click Customization, and then click Customize Entities.
- Click Account, and then click Publish on the toolbar.
- Open a bulk edit form for Account1 and for Account2.
- 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.
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">