You need to sign in to do that
Don't have an account?

UserRecordAccess query problem.
Hi all,
I have to check if some users has access to some accounts.
I tryed query UserRecordAccess but as I know I cant put two list in conditions...
I tryed something like that:
[ SELECT RecordId
FROM UserRecordAccess
WHERE HasEditAccess = true ANDRecordId IN : sRecrdsIds AND UserId IN : sUsersIds
];
Is it even possible to check if for eg 10 users has access to 10 accounts?
Or mayby is there some other, smarter way to achive that? :)
The UserRecordAccess does not allow you to have filtering on list of userids. What you could do instead is to select all the users who have the edit acess on the selected records and put them in a map<userid, record> and then check the access for your users using the userid as a key in the map.
As I said I try to put two list (but this is Impossible), so I am looking for solution which will give me simular result like my query.
And I wonder if it is even possible....
Map <userid, record > will be nice if I will check access.
But creating this map mean put query in the loop, isn't it?
For 10 users I will have to put 10 querys?
Is it possible to achieve my goal in any other way not using query in the loop?
Yes I think there is no way currently to avoid the queries. The map would help you keep the data across various loops.