I've a object called myobject__c. This object is private in OWD Setting.

Now when admin create a new record of this object then I want to share this record with a user(community user). For this I've written a code in trigger to create a sharing record of this object (myobject__Share).

But I am getting a problem of :-

FIELD_INTEGRITY_EXCEPTION: field integrity exception: unknown (invalid user or group: 005XXXXXXXXXXXXX).

how can I solve this problem and second doubt is can we create share record for community user or not.

  • What type of Communities user license is it, Customer or Partner?
    – greenstork
    Jul 22, 2014 at 14:31
  • The license type is Customer Community Login.
    – D-Horse
    Jul 22, 2014 at 14:45

1 Answer 1


Customer Communities users do not have access to the full sharing model and therefore can't be added on a __Share record. The only way to share a record with a Customer Communities user is through Sharing Sets and Sharing Groups.

  • 2
    I believe Customer Community Plus users can participate in the full sharing model. Feb 11, 2017 at 16:50
  • 1
    Customer Communites Plus licenses do have access to the sharing model, and my answer should be revised as these licenses did not exist in 2014 when this answer was posted.
    – greenstork
    Feb 12, 2017 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .