1

For one of my current project I am working on following requirement,

Whenever a User Opens any item in SharePoint List on edit form, display form, I want to check if the item being opened satisfies the default view filter conditions for that list. I want to implement this requirement to ensure that user not having rights on any item (as per the default view filters) should not be able to open the item by directly putting id in URL.

I have tried below options for this,

OPTION 1 Get CAML query of List View, add an AND condition for specific item ID being opened and check if it satisfies condition.

But, it is not performance efficient it takes a lot of time for query to execute.

OPTION 2 (actual solution is required for this option)

I want to simply query an item from list by id. and then when it is returned from SharePoint, I want to dynamically check if it satisfies CAML query condition.

Any help would be highly appreciated.

2
  • I don't think we can execute a CAML query locally on client side like you want in Option 2. You can try the first option with REST API using CAML Queries and see if the resulting JSON count is equal to 1 Commented Mar 28, 2018 at 6:12
  • This question should help you sharepoint.stackexchange.com/questions/208020/… Commented Mar 28, 2018 at 6:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.