locked
Hide section based on security role in ms crm 2013 RRS feed

  • Question

  • HI 

    I need to sections based on security role...

    Monday, May 11, 2015 1:48 PM

All replies

  • Monday, May 11, 2015 5:54 PM
  • Using XrmServiceTolkit: http://xrmservicetoolkit.codeplex.com

    1. check security role in onload:

    var isSystemAdministrator = XrmServiceToolkit.Soap.IsCurrentUserRole("System Administrator");
    

    2. find section in tab and set visibility:

    Xrm.Page.ui.tabs.get("TabName").sections.get("SectionName").setVisible(false);

    Tuesday, May 12, 2015 6:36 AM
  • You could also take a 'no code' approach and create separate forms and restrict them to each security role. That's the purpose of multiple forms to show users different fields/sections/tabs depending on security role. It's also much easier to change in future instead of jscripting it.

    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    Tuesday, May 12, 2015 10:15 PM
    Answerer