Development questions
Write a SOQL query to find all AccountShare records for a specific Account to inspect manual and Apex sharing reasons (RowCause).
Each sharing-enabled object has a Share object (e.g. AccountShare) holding the sharing grants. Filter by AccountId and inspect RowCause to see why access exists.
soql
SELECT Id, AccountId, UserOrGroupId, AccountAccessLevel, RowCause
FROM AccountShare
WHERE AccountId = :accId
RowCause values include Owner, Manual, Rule, Team, Territory, and Apex sharing reasons for custom objects.
soqlscenariosharingsetup-objects
More Development questions
- What is an Apex Trigger in Salesforce and when should you use it over Flows?
- What is the difference between before triggers and after triggers?
- Explain all Trigger context variables (isInsert, isUpdate, isDelete, isUndelete, isBefore, isAfter, isExecuting, size, operationType).
- What is the difference between Trigger.new and Trigger.old?
- In which trigger events are Trigger.new and Trigger.newMap available?
- In which trigger events are Trigger.old and Trigger.oldMap available?