Manage Role Based Forms

[Applies to: Microsoft Dynamics CRM 2011]

When you have more than one main form defined for an entity, you can select which forms users will see based on their security roles. Because each entity must be able to display a form for any user, at least one form must be designated as a ”fallback” form – a form visible to users whose security roles do not have any forms explicitly assigned to them.

Managing the Fallback Form

Within the Form editor or from the Forms grid you can assign security roles to a form. However, if there is only one form for the entity, you will not be able to clear the Enabled for fallback option in the Assign Security Roles dialog box. In this case, even though you have assigned security roles to the form, anyone associated with a security role you did not include will still be able to view the form because it is enabled for fallback.

After you create a second main form for the entity, you will be able to clear the Enabled for fallback option for one of them. The system will always make sure that at least one form is enabled for fallback.

Strategies to Manage the Fallback Form

Strategies to manage the fallback form include the following:

  • Don’t Use Multiple Forms

  • Create a Contingency Form

  • Create a Generic Form

  • Use Form Scripting

Don’t Use Multiple Forms

If you do not require multiple forms for an entity you do not need a fallback form. All users view the same form.

Create a Contingency Form

If you are using role-based forms because you want to restrict the information people might view or edit, consider creating a form that has a minimum of information displayed. Then, in the Assign Security Roles dialog box, select Display only to these selected security roles, but do not select any roles except System Administrator, and select Enabled for fallback. The result is that this form will never be seen by anyone except the System Administrator and anyone whose security roles have not been associated with a specific form. You could include a HTML Web Resource in the form with information about why little information is visible in the form and a link to information about how to request being added to a security role that is associated with a from or to include a new security role for a form.

Create a Generic Form

If you use role-based forms to provide a customized user experience based on a person’s role in the organization, you can set your least specialized form as the fallback form and configure it to display for everyone. Then, create customized forms for specific security roles and configure those forms to only display for security roles that require them. Do not enable these forms for fallback. Finally, in the Forms list use the Form Order dialog to specify which forms to display ranking them from most exclusive to least exclusive. Your fallback form will be at the bottom of the list. This strategy will cause people seeing the form that has been customized for their role as the default form, yet they can still use the form selector to select the most common form if they want. Whatever form they select will remain their default form until they select a different form.

Use Form Scripting

Finally, you can use scripts in the form Onload event to use the Xrm.Page.ui.formSelector Remember that the navigate method will cause the form to load again (and the Onload event to occur again). Your logic in the event handler should always check some condition before you use the navigate method to avoid an endless loop or unnecessarily restrict users options to navigate between forms.

See Also

Concepts

Customize Entity Forms
Create New Entity Forms
Change Form Navigation
SystemForm (System Dashboard) Entity Metadata
SystemForm (System Dashboard) Entity Messages and Methods

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.