1

You cannot perform DML on ContentDocument (and possibly, ContentDocumentLink too). You only need to insert a test record into ContentVersion and salesforce will automatically create corresponding test records into ContentDocument and ContentDocumentLink objects (which you can query after ContentVersion insert DML). Following code should be good enough in ...


1

I may be wrong here, but don't you need to insert ContentDocumentLink a and ContentDocument b too?


Only top voted, non community-wiki answers of a minimum length are eligible