• Ilarion Tokarskiy 10
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
The user does not see the contact when adding the ContactShare

Code in Trigger:
User user = [SELECT Id FROM User WHERE Alias = 'mmana']; Contact contact = [SELECT Id FROM Contact LIMIT 1]; ContactShare contactShare = new ContactShare();
contactShare.Contact = contact;
contactShare.ContactId = contact.Id;
contactShare.UserOrGroupId = user.Id; contactShare.ContactAccessLevel = 'Edit';
insert contactShare;

Organization-Wide Defaults
Account: Private
Contact: Private

How can i solve this problem with Apex?