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
sf.freelancesf.freelance 

How to control the share of object recorder

I create a custom object "A". and create recorder a1,a2 as "A"
I have 2 users u1,u2, I want to allow u1 access a1, and u2 access a2.
How can I do that with Apex code?
sf.freelancesf.freelance

I can use sharing rule to set access grant, but how can I set every recorders in object with different user.

I want to make a trigger to set it, when I create new object.

A_SmithA_Smith
Can you make u1 the owner of a1? Or will there be more than one user?

Andrew