Open
Description
How would one use Unit of Work to create ContentDocumentLink records?
For example:
- Insert sObject record (registerNew)
- Insert ContentVersion record (registerNew)
- Insert ContentDocumentLink (registerNew - but with ContentVersion.ContentDocumentId)
Using registerNew(contentDocLink, ContentDocumentLink.ContentDocumentId, contentVersion) obviously doesn't work because we need the ID of the Content Document, not the Content Version. It would be nice if the library could handle these object without the need to add custom code.
However, I know there are many other high-priority issues, and for now I would be happy if anyone could provide a bit of guidance on how to implement this myself. I saw blog post comment that suggested doing this in a custom IDoWork method, but I'm not at all clear on how that could be accomplished. I couldn't find anything in the linked documentation or through online searches.
Thanks!