You need to sign in to do that
Don't have an account?
Leah Schneider
Sharing files with Apex
I would like to set up a process that all files are editable by the whole company. I can set each file manually to have whole company collaboration but this is a pain and forces users to memorize steps. I tried to have a trigger on insert that would add a ContentDocumentLink with a link to the org Id and sharing set to C. As far as I can tell, the documentation out there says that what I'm doing is correct.
Apex is below. It hits the try/ catch below and fails with "12:24:06:252 USER_DEBUG [16]|DEBUG|Exception occurred on insert: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Invalid sharing type C: [ShareType]"
Apex is below. It hits the try/ catch below and fails with "12:24:06:252 USER_DEBUG [16]|DEBUG|Exception occurred on insert: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, Invalid sharing type C: [ShareType]"
All Answers