Skip to main content

Notifications

Announcements

No record found.

Supply chain | Supply Chain Management, Commerce
Suggested answer

Restriction by queries and policy not working

Posted on by 75

Hello guys,

I am trying to create some queries that will restrict records in All purchase orders form, I want to see only PO that belongs to the project with Project ID starting with AB* and that have PO status as Open order. I have created new Query, with the datasource ProjTable, on this data source I have created a new range, AB*. Then in this datasource I have added another one, PurchTable, and on this datasource, I have created new range for Purchase order status field set as Open order. 

Than I have assigned this query

0601.pastedimage1674417554225v3.png 

to the security policy, 

6864.pastedimage1674417431472v2.png

where is the Context Type set as RoleName and the role name is set in the properties as well. The role is then assigned to the user that should be restricted. 

The restriction works fine for the Project ID, the user can see only projects starting with AB, but can see PO with all of the PO status, the range in the query does not affect the PO status. Does someone know, please, why is this happening? I have tried to clear usage data for example, but still the same issue

When I have created the query/policy in this way before, it worked fine, but now I have this issue. 

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,269 Super User 2024 Season 2 on at
    RE: Restriction by queries and policy not working

    Hi Sayid,

    In this policy, the ProjTable is the primary table and determines which records are visible. The additional constrained tables will not inherit ranges from the security query. If you need to have the additional filter for the POs, you will need a second security policy starting with the PurchTable.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans