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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Forms and their security roles

(0) ShareShare
ReportReport
Posted on by 1,077

Hello,

How do we get list of all forms for an entity in CRM along with assigned security roles? Basically, list of security roles and forms assigned to it. Any thoughts?

I have the same question (0)
  • Suggested answer
    rthompson Profile Picture
    1,532 on at

    Have you tried using the Metadata Browser Tool

  • Vijayakumar Kenchugundu Profile Picture
    1,077 on at

    Hi rthompson,

    Yes. I have see Metadata browser. It is completely different than what I am asking. It is not helpful.

  • Suggested answer
    rthompson Profile Picture
    1,532 on at

    Try using the XrmToolBox  FetchXML builder

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi  @Vijayakumar Kenchugundu,

    i think i've something for you:

    You can find more informations about forms by querying the systemform Entity.

    Here's a quick codeless way to take a look at those informations:

    paste this URL:   *YOURORG*/api/data/v9.0/systemforms?$select=formxml,name&$filter=objecttypecode%20eq%20%27contact%27

    formxml and name are just two of the systemform's properties that i choose to retrieve, i also filtered the form by retrieving only those related to contact entity.

    This is what you should get:

    pastedimage1584639132468v1.png

    I've highlighted some useful informations such as type,name, roleid (which shows to what user role the form is available to) and formid.

    To get role name go to:

    *yourORG*/biz/roles/edit.aspx?id={*place here the guid*}

    Here you can find the documentation about systemform entity and all properties that could help you to shed light on your form!

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/systemform?view=dynamics-ce-odata-9

    Hope it helps!

    Marco


    If you found the answer helpful for you or other readers, please mark as Verified.

  • Vijayakumar Kenchugundu Profile Picture
    1,077 on at

    Hi Marco,

    Thanks for your response. This is going to be definitely a lengthy workaround. I am on CRM Onpremise and have access to database. Is there any query to pull the such results so that it would be easy to get for all forms instead of working on each formxmls one by one?

  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    On premise...the better!

    Query sistyemform entity , maybe use some open xml to retrieve only the roles nodes, join with role to get the role name and filter the objecttypecode to get only the form of a specif entity.

  • Fubar Profile Picture
    2,761 on at

    As it happens I needed a list of forms the other day, it does not extend to the Security Roles (and is currently set to only find formtype = 2 main)  but it will give you a starting point (objecttypecode is the entity) use the FetchXML Builder in XrmToolBox.

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">

     <entity name="systemform">

       <attribute name="formid" />

       <attribute name="name" />

       <attribute name="formactivationstate" />

       <attribute name="publishedon" />

       <attribute name="ismanaged" />

       <attribute name="objecttypecode" />

       <filter type="and">\

    <condition attribute="type" operator="eq" value="2" /></filter>

       <order attribute="name" />

     </entity>

    </fetch>

  • Suggested answer
    Ihno Profile Picture
    32 on at

    Hi, based on the previous answers I found a way to list all forms that are linked to a certain role 

    1) get the role ID

    <fetch>
    <entity name="role" >
    <attribute name="roleid" />
    <attribute name="name" />
    <attribute name="businessunitid" />
    <filter type="and" >
    <condition attribute="name" operator="eq" value="[enter the role name here]" />
    <condition attribute="parentroleid" operator="null" />
    </filter>
    </entity>
    </fetch>

    2) Filter the forms based on the formxml (it somewhere has <DisplayConditions> and the role ID, see screenshot from Marco P.

    <fetch>
    <entity name="systemform" >
    <attribute name="name" />
    <attribute name="publishedon" />
    <attribute name="uniquename" />
    <attribute name="objecttypecode" />
    <attribute name="formxml" />
    <filter type="and" >
    <condition attribute="formxml" operator="like" value="%DisplayConditions%" />
    <condition attribute="formxml" operator="like" value="%[Enter the role ID here]%" />
    </filter>
    </entity>
    </fetch>

    Best regards 

    Ihno

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans