AX – D365FO – Find Roles related to a Duty

There are 2 ways to retrieve roles of a Duty.

The first is by going in AOT, the second is to do a SQL Query.

First Approach :

  • Open AOT under the node Security –> Duties

Then search your duty, right click on it and go into Add-Ins –> Security tools –> View related security roles

Here you can find the roles assigned to your duty

Second Approach :

  • Do a SQL Query in your AX Database
SELECT T1.NAME,

       T1.ALLOWPASTRECORDS,

       T1.ALLOWCURRENTRECORDS,

       T1.ALLOWFUTURERECORDS,

       T1.DESCRIPTION,

       T1.AOTNAME,

       T1.ISENABLED,

       T1.CONTEXTSTRING,

       T1.RECVERSION,

       T1.RECID,

       T2.SECURITYROLE,

       T2.SECURITYSUBROLE,

       T2.VALIDFROM,

       T2.VALIDFROMTZID,

       T2.VALIDTO,

       T2.VALIDTOTZID,

       T2.RECVERSION,

       T2.RECID,

       T3.NAME,

       T3.ALLOWPASTRECORDS,

       T3.ALLOWCURRENTRECORDS,

       T3.ALLOWFUTURERECORDS,

       T3.DESCRIPTION,

       T3.AOTNAME,

       T3.ISENABLED,

       T3.CONTEXTSTRING,

       T3.RECVERSION,

       T3.RECID,

       T4.SECURITYROLE,

       T4.SECURITYTASK,

       T4.RECVERSION,

       T4.RECID,

       T5.NAME,

       T5.AOTNAME,

       T5.ISPERMISSIONSET,

       T5.DESCRIPTION,

       T5.TYPE,

       T5.ISENABLED,

       T5.RECVERSION,

       T5.RECID

FROM  [AX6_ERA_DEV_model].[dbo].SECURITYROLE T1 LEFT

OUTER

JOIN [AX6_ERA_DEV_model].[dbo].SECURITYSUBROLE T2 ON (T1.RECID=T2.SECURITYROLE) LEFT

OUTER

JOIN [AX6_ERA_DEV_model].[dbo].SECURITYROLE T3 ON (T2.SECURITYSUBROLE=T3.RECID) CROSS

JOIN [AX6_ERA_DEV_model].[dbo].SECURITYROLETASKGRANT T4 CROSS

JOIN [AX6_ERA_DEV_model].[dbo].SECURITYTASK T5

WHERE ((T1.RECID=T4.SECURITYROLE)

       OR (T3.RECID=T4.SECURITYROLE))

       AND ((T4.SECURITYTASK=T5.RECID)

       AND (T5.AOTNAME='AccrualFIT'))     //Write here your Duty AOT name

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s