You need to sign in to do that
Don't have an account?
Pasan Eeriyagama
How to share record with a community user?
I'm trying to share a record for community user. Tried below code in Execute anonymous.
But unfortunately it fails with error "Line: 14, Column: 1
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (invalid user or group: 005f4000000vjvX): [unknown]" .
Is it not possible to grant sharing access to community users via manual sharing? I could not find a related documention on it. Or should I set some configuration settings for this.
Appreciate any help. Thanks.
Note: This could have been achieved using Sharing sets in Community setttings, but due to design constraint we're not able to use it.
// Create new sharing object for the custom object. myObject__Share objShare = new myObject__Share(); // Set the ID of record being shared. objShare.ParentId = 'a0Vf4000001Hprq'; //recordId; // Set the ID of user or group being granted access. objShare.UserOrGroupId = '005f4000000vjvX'; // Set the access level. objShare.AccessLevel = 'Read'; insert objShare;
But unfortunately it fails with error "Line: 14, Column: 1
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (invalid user or group: 005f4000000vjvX): [unknown]" .
Is it not possible to grant sharing access to community users via manual sharing? I could not find a related documention on it. Or should I set some configuration settings for this.
Appreciate any help. Thanks.
Note: This could have been achieved using Sharing sets in Community setttings, but due to design constraint we're not able to use it.
Roles and Advanced Sharing is not available for Customer Community user.