function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sanjana BillaSanjana Billa 

Hello... Can someone help me with setting OWD as private using triggers

Christan G 4Christan G 4
Can you elaborate more as to what the requirement is?
Sanjana BillaSanjana Billa
Hi, Thanks for your quick response. So as per my requirement I need to set owd to private for opportunity object using triggers. So do I need to use OpportunityShare object or is there any procedure to achieve this?
Christan G 4Christan G 4
Hi Sanjana and sure. If there is no condition, you can do this by navigating to Setup. Then, in the quick find search box, put "Sharing Settings. Click on the Share Settings Link. You'll see "Organizational-Wide Defaults" and an edit button in the middle of the page. Click on the edit button. In the Object list, go to "Opportunity" and set its "Default Internal Access" to Private. Finally, save the change.

If there is a condition, what is the criteria for when the trigger should be executed?