Tuesday, July 24, 2012

Working with CRM 2011 Multiple Forms

Multiple forms concept came to CRM with 2011 edition. Previously we only had one form per entity. This was fine, but we needed to use javascript to hide fields based on the security role of the user (if the user was not supposed to see a particular field due to security)

With CRM 2011 we don’t have to use javascripts for this. Of course this is still possible. But there is another way of getting this done. You can use multiple forms.

You can have a form to represent a particular security role and you can have only the fields that particular user role should be seeing. So no more javascripts are needed for this.

However if this is not the reason that you have multiple forms in, but for another reason such as
•    Depending on a particular response the form should be picked
then we need to do some changes.

We had the same scenario and were greatly helped by the following blog posts.

http://www.avanadeblog.com/xrm/2011/06/crm-2011-form-navigation.html

This post describes how to do it.

http://social.microsoft.com/Forums/zh/crmdevelopment/thread/c06033d2-e158-4931-9340-e1de39c1d09e

This blog post has implemented it.

There are pros and cons for each method. The best method to do this cannot be pinpointed as it would depend on the requirement.

In our case we went ahead with

Xrm.Page.ui.formSelector.items.get(itemId).navigate(); (
itemId being the form name or form id)

No comments:

Post a Comment

Retrieving Calendar of a Bookable Resource in Dynamics

There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...