Salesforce
PDII · Question #328
Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers' sales representatives can edit the orders on the…
The correct answer is A. Use System.runAs() to test as a sales rep and a community user. See the full explanation below for the reasoning.
Question
Universal Containers allows customers to log into a Salesforce Community and update their orders via a custom Visualforce page. Universal Containers' sales representatives can edit the orders on the same Visualforce page. What should a developer use in an Apex test class to test that record sharing is enforced on the Visualforce page?
Options
- AUse System.runAs() to test as a sales rep and a community user.
- BUse System.profileIs() to test as a sales rep and a community user.
- CUse System.runAs() to test as an administrator and a community user.
- DUse System.profileIs() to test as an administrator and a community user.
How the community answered
(20 responses)- A75% (15)
- C10% (2)
- D15% (3)
Community Discussion
No community discussion yet for this question.