Question 1 of 29
In a Salesforce organization, a developer is tasked with implementing Apex Managed Sharing for a custom object called \"Project__c.\" The organization has a requirement that only users with the \"Project Manager\" role can share records of this object with other users. The developer needs to ensure that the sharing rules are applied correctly based on the user\'s role and that the sharing records are created dynamically when a new project is created. Given this scenario, which approach should the developer take to implement Apex Managed Sharing effectively while ensuring that the sharing records are created only when necessary?
Use the `Share` object to create sharing records in the `after insert` trigger of the `Project__c` object, checking the user's role before creating the sharing record.
Implement a `before insert` trigger on the `Project__c` object to create sharing records based on the user's role.
Use a scheduled job to periodically check for new `Project__c` records and create sharing records based on the user's role.
Create a custom button on the `Project__c` page layout that allows users to manually create sharing records based on their role.

Preparing for SalesForce Certified Sharing and Visibility Architect Certified Sharing and Visibility Architect? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free