Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to implement UOW for ContentDocumentLink? #284

Open
lindsayholmes-gears opened this issue Jun 4, 2020 · 1 comment
Open

Comments

@lindsayholmes-gears
Copy link

How would one use Unit of Work to create ContentDocumentLink records?
For example:

  1. Insert sObject record (registerNew)
  2. Insert ContentVersion record (registerNew)
  3. 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!

@afawcett
Copy link
Contributor

@lindsayholmes-gears could one of the extensibility features of UOW such as a IDoDML or virtual methods - but used to add this behavior - it does feel quite specific to add directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants