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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Record Level Security

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have created a query for inventDim table and give the range as 'inventSiteId = !2 !3 !4 !5 !6'. and i created a new policy by setting this as primary table as 'inventDim' and setting this Query and i added some Constrained table to restrict the Sites for several forms and the problem i am facing is , when this policy has assigned to one of the user , he can able to see site : 1 in every forms , but when he face situation like InventDim::findOrCreate(inventDim).inventDimId in his code , the mentioned find method returns empty inventDimId , so it tries to create it and am getting error 'Cannot create inventDimId the record already exists'. 

Note : i am setting the Operation property for the Policy as 'Select' only and here i am getting to restrict the other sites to the particular user. Any Idea guys??

*This post is locked for comments

I have the same question (0)
  • Mahmood Ul Hassan Profile Picture
    69 on at

    Will you share the screen shot of your query ?

  • Community Member Profile Picture
    on at

    2273.query.PNG

  • André Arnaud de Calavon Profile Picture
    304,315 Super User 2026 Season 1 on at

    Hi Vairam,

    You cannot constrain the InventDim or InventSum table without changing the x++ logic to handle all kinds of inventory transactions (create, post, etc). You can actually restrict tables like sites, warehouses and worksheet type tables like sales order lines, purchase order lines and inventory journal lines.

    What do you want to achieve exactly?

  • Javirrubio Profile Picture
    965 on at

    Hi Vairam,

    XDS Security doesn't work well when you restrict InventDim or InventSum tables. An alternative approach would be to use Record Level Security instead. Would that fit your requrements?

  • Community Member Profile Picture
    on at

    Hi Andre,

    Here i am having a list of roles , in which they are restricted to see only  particular sites in all their Forms , so i created the policy for inventDim table , but the InventDim::findOrCreate() method doesn't finding the inventDimId from the inventDim table even though the site value is given in the range of our Policy Query

  • Community Member Profile Picture
    on at

    Hi Javier Rubio,

    When using Record Level Security also am facing the same Error

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Vairam,

    You need to modify your query. You should take InventSite and InventDim and join them on inventdimid, add your range of siteid in inventdim.

    Create a policy and make InventSite as primary table in your policy.

    I believe it will help you and resolve the issue.

    Regards,

    Gaurav

  • Javirrubio Profile Picture
    965 on at

    If it fails it might be because your XDS policy is still active, don't think it's because of the Record Level Security

  • Suggested answer
    XB Profile Picture
    1,875 on at

    I have the same problem and I solve creating politcy for inventLocation instead of InventDim

    Example:

    http://axlearn.blogspot.com/2017/05/12-politicas-de-seguridad-nivel-de.html

  • Verified answer
    André Arnaud de Calavon Profile Picture
    304,315 Super User 2026 Season 1 on at

    Hi Vairam,

    You can download an example on warehouse restrictions. You could change it to constrain on site level initially instead of the warehouses. Visit my blog to get access to the example(s): kaya-consulting.com/extensible-data-security-examples

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans