Thursday, July 7, 2011

CRM 2011 Bulk Edit - Scripts Not Running? Fields disabled?

Similar to MSCRM 4, events won't fire by default in CRM 2011.  Also, any field with an onchange event will be rendered disabled!  There is a nasty way to go about it enabling these fields or allowing your scripts to execute.

Export the entity you wish to enable scripted bulk edits for in an unmanaged solution.  Un-zip the package and open up customizations.xml.

To allow an event, follow the below xpath which will take you to the events for a form.  If you have multiple forms, you may repeat for each form (TBD:  not sure if these appear under systemform or not).  If you're enabling for multiple entities, you may repeat for each entity.

\\ImportExportXml\Entities\Entity[@name='new_entityname']\FormXml\forms[@type=’main’]\systemform\form\events\event[@name=’onload’]


This xpath takes us to the onload event for the main form of the new_entityname entity.  To this node, we need to add the BehaviorInBulkEditForm attribute.

<event name="onload" application="false" active="true" BehaviorInBulkEditForm="Enabled">

  • Enabled - If this is an event related to a field (onchange), then the field will be enabled.  The script will run.
  • EnabledButNoRender - If this is an event related to a field (onchange), then the field will be enabled.  However, the script will not run.
  • Disabled - (default) If this is an event related to a field, then that field will be disabled.  The script will not run.


Official knowledge base article:  http://support.microsoft.com/kb/949941

1 comment:

Unknown said...

I will try this. Good information