Question:
How to check whether the user has access to a specified record from the database in Online CRM?
Answer:
Query the UserRecordAccess object in the database, specifying the RecordId and UserId. Check the permission information for the following fields:
- HasAllAccess
- HasDeleteAccess
- HasEditAccess
- HasReadAccess
- HasTransferAccess
The Salesforce Object Query Language (SOQL) appears as:
SELECT HasAllAccess,HasDeleteAccess,HasEditAccess,HasReadAccess,HasTransferAccess,RecordId FROM UserRecordAccess WHERE RecordId = '<record id>' AND UserId = '<user id>'
Related Documentation:
N/A
Send us your feedback: We are always looking for feedback to help improve our Knowledge Base! Please let us know if this article is helpful or provide feedback on how we can improve your experience by clicking here.