How to check the field access by querying UserFieldAccess table?
1. Obtain the DurableId first before using it in the Query.
Example query to obtain the DurableId of the Account.Name field:
SELECT Durableid FROM UserFieldAccess
AND User.Id='<userId for the user you want to check field access for>'
Please Note: DurableId is a unique identifier for the field. Retrieve this value before using it, as the value is not guaranteed to stay the same from one release to the next.
2. Use the unique DurableId returned above to query UserFieldAccess.
SELECT DurableId,EntityDefinitionId,FieldDefinitionId,Id,IsAccessible,IsCreatable,IsUpdatable,UserId FROM UserFieldAccess WHERE DurableId = '<DurableId returned in query 1>'
Send us your feedback: We're always looking for advice to help improve our Knowledge Base! Please let us know if this article was helpful or provide feedback on how we can improve your experience here.