Skip to content

Question: How to implement UOW for ContentDocumentLink? #284

Open
@lindsayholmes-gears

Description

@lindsayholmes-gears

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions