You need to sign in to do that
Don't have an account?

Can not create Sharing record for Community users
I have a custom object 'Plan'.I am trying to share it with all the community users(which contains users with different profiles) through apex code(Plan_share object)
BUT facing an exception as:
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: unknown (invalid user or group: 005U0000002hje3): [unknown]
whereas If I go the same Id i.e;005U0000002hje3 in my org ,there exist a valid community user with this id.
Can anybody suggest what I am missing here??
Yes,my user has a Customer Community license.
Is there any work around for this?
Give that a shot. If that doesn't work for any reason, you will have to make a Visualforce page that has an extension class where you query the object and specify "without sharing" in your class.
#1) You can set the Organization-Wide Defaults to public read only or public read-write and make sure grant access using hierarchies is unchecked.
- Tried with this approach,not working seems something is missing.
#2) If that doesn't work for any reason, you will have to make a Visualforce page that has an extension class where you query the object and specify "without sharing" in your class
- My class is already 'without sharing' but doesn't help in removing the exception.