thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Business Platforms & EA · Advanced

Apex Managed Sharing

Programmatic record sharing using Apex to insert rows into an object's share table, often with a custom sharing reason.

Definition

Developers create records in share objects such as Job__Share with AccessLevel and RowCause. Shares with a custom Apex sharing reason persist through owner changes, unlike manual shares. Only users with Modify All Data can modify these shares in the UI.

Example

insert new Job__Share(ParentId=jobId, UserOrGroupId=uid, AccessLevel='Read', RowCause=Schema.Job__Share.RowCause.Recruiter__c);

Exam tip

Apex sharing reasons are available only for custom objects.

Related terms