Home dynamics ax, others, sql server How To Create A Security Role Based On Table/Query
dynamics axotherssql server

How To Create A Security Role Based On Table/Query


  • user can Access to ALL MTL warehouse
  • user can Access to ALL TJP warehouse exclude to “Finished Goods Warehouse TJP” warehouse
  • MTL, TJP is Entity

I put the XPO on the end of this article

How to do it manually

  • Goto Dynamics Ax, and Open AOT
  • we will need, 1 Security Policy, 2 Tables, 1 Query and 1 Roles (check the picture below)
InventDim and InventLocation table was added on group Table, as for reference on this queries

step 1, create the role, the “HpgRlExclWhTjp111” role is empty role, and will attached to intended users

this role was supposed to be linked to users that only cannot access to TJP 111

step 2, create the “HpgQrExclWhTjp111” queries, see the picture below

create a relation between inventdim and inventlocation on this queries, and remember to filter by range

step 3, create the “HpgSpExclWhTjp111” Security Policy

remember to put primary table, constrained table and role name
if incase you need to change the role name, change the contexttype first and change it to RoleName again

lastly added this role onto the users

please comments if this articles works on your enviroments

Click here to get the XPO Files



Leave a Reply