Activity Forums Salesforce® Discussions Is it possible to grant delete permission using apex managed sharing? Reply To: Is it possible to grant delete permission using apex managed sharing?

  • Gourav

    Member
    April 26, 2016 at 10:48 am

    Hi Dana,

    Try this code block to grant 'All' permission to user using apex

    ObjectName__Share instance = new ObjectName__Share();
    instance.ParentId = Object.id;
    instance.UserOrGroupId = User/Group.id;
    instance.AccessLevel = 'All';
    instance.RowCause = Schema.ObjectName__Share.RowCause.Manual;

    Insert/update instance;

     

    Hope above helps you.