web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Business Unit Based Forms

(0) ShareShare
ReportReport
Posted on by

I see mention of showing forms based on Role.  For example I can add some fields to the Account form and only use that version for users with a specific role.

Can I do the same for user with a specific business unit?

Thanks,

Chris

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at

    You can do this, but need some custom coding..

    you need to add some java script code on form load, check current user business unit, and based on business unit redirect user to specific form.

    1. You can get current user id by using page context as

    var currentUser = Xrm.Page.context.getUserId();

    2. This will give you current logged in userId, then retireve current user's business unit from CRM using javascript

    Here are some code samples to get user business unit

    [View:http://yeskanagaraj.blogspot.com/2013/01/get-current-user-business-unit-in-crm.html?_sm_au_=iVV2kFKMNK43bG0R:0:0]

    [View:http://mscrmblogger.com/2009/09/30/get-current-users-business-unit-for-hiding-fields/:0:0]

    3. Then you need to select form based on business unit

    here is how to open specific form

    [View:https://msdn.microsoft.com/en-us/library/gg309560.aspx:0:0]

    This way you can show specific form to user based on business unit..

    Hope this will help..

  • Michal Abraham Profile Picture
    385 on at

    Hi,

    wiithout coding, you could add a specific (even no privilege) role to each business unit. Then assign the role to all users in the business unit and assign the roles to the forms.

    Regards,

    Michal

  • Community Member Profile Picture
    on at

    Building further on Michal's suggestion, create security roles with no privileges  in the root BU (you cannot assign roles to forms if the roles are not in the root BU). These might have names such as "Access to Account form: Finance" or "Form access role: Contact Marketing form".

    Assign these roles to the appropriate forms.

    Assign the relevant security role(s) to the default team of each business unit, so by definition the role is associated with all the users who are in the BU, since they are automatically in the default team.

    So the Marketing default team in the Marketing BU might have several roles so that Marketing people see different forms for Lead, Contact and Account than other users.

    Getting your form order right is the last challenge, but if these are all mutually exclusive, this is usually easier.

  • Community Member Profile Picture
    on at

    Adam,

    I like this strategy as it does not require coding and is based on team roles which is easier to manage.  After I create the roles and assign them to the teams how do I set it up that a specific form is the default for that role/team. For example when someone in the xyz BU clicks on an account form account_xyz loads and then someone in the abc BU clicks on an account form account_abc loads.

    Thanks

  • Community Member Profile Picture
    on at

    Open each form, click on Enable Security Roles in the ribbon. Or on a list of forms, select one and click Enable Security Roles.

    Select the roles that should be able to use this form. So you might have one form for Account that is shared by Sales and Marketing (so assign both roles), but for Lead you might have one form for Marketing and one for Sales (so assign one role to each form).

    You do need to have a form that is configured for "fallback" - if a user has no roles associated with any specific form, this is the form they will see (instead of an error).

    From your list of forms for an entity, click Form Order > Main form set. In the dialog box that appears, select a form and click "enable for fallback". Usually choose a form that is the most generic and all-purpose.

  • yleclerc Profile Picture
    1,549 on at

    Great advice Adam! Thanks!

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi there,

    i have a working code for you , i have recently wrote a blog on this :

    rawishblog.wordpress.com/.../show-entity-form-based-on-a-field-value-in-microsoft-dynamics-crm  

    i am checking a value from system user from owner id and switching the form. you should be able to modify it as per your need.

    mark my suggestion as verified if helpful to close the thread.

  • Community Member Profile Picture
    on at

    Adam, I have stumbled upon your advice. It works for me too. How do I set a default form for a security role? Say, I have created a different Account Form and assigned security roles to it. When users in this role create a new form, what will they see?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans