Tuesday, May 26, 2009

Bulk Edit Issue on Custom Entities

A typical problem while performing a Bulk edit on any custom entity is that all the hidden fields on the form become visible. Since MS CRM does not provide a way out to let the fields remain hidden on bulk edit form, you might think of restricting users from performing bulk edits for custom entities.
Here is the simple way to proceed on this:

1. On the custom entity Form, add a hidden Iframe.
2. Create a simple .htm file and create a new virtual directory in IIS under the ISV folder where you place this htm page.
3. Specify this relative path as the URL of the iframe.

Example if your custom application is hosted at \ISV\MyCustomWebPages folder and the .htm file is MyPage.htm, the Iframe URL would be \ISV\MyCustomWebPages\MyPage.htm.

In the .htm file, check the form type for Bulk Edit. MSCRM by default provides form type an enum for form types. (See SDK:
http://technet.microsoft.com/en-us/library/cc150873.aspx ) Bulk edit type form value is 6.

if(parent.document.forms[0].FormType == 6)
// parent.document.forms[0] is the reference for the custom entity form
// Do required
alert("Bulk Edit is restricted for this entity");

This code would check if the user wants to perform a Bulk edit for the custom entities. If so, it alerts the user and closes the form.

Note: This behavior is not reproducible for out of the box entities.

1 comment:

  1. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating. Power Bi Online Training hyderabad