Created
June 25, 2015 20:22
-
-
Save ryanguest/65a4ea1152455716fb12 to your computer and use it in GitHub Desktop.
ContentDocumentLink example from Apex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String ACCOUNT_ID = '001D000000K2ES6'; | |
ContentNote n = new ContentNote(); | |
n.title = 'My Note from Apex'; | |
insert n; | |
ContentDocumentLink link = new ContentDocumentLink(); | |
link.LinkedEntityId = ACCOUNT_ID; | |
link.ContentDocumentId = n.id; | |
link.ShareType = 'V'; | |
link.Visibility = 'AllUsers'; | |
insert link; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enabling this triggers gives error to community user while creating Notes.