function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ZANE PRATERZANE PRATER 

How to retrieve the latest content document version of a custom object in a flow or custom controller?

pconpcon
Are you trying to simply query the ContentDocument [1] object for an object?  And you please expand on what you are trying to do and what you have already tried.  Only asking this type of question in the subject of a post does not give us much to go on.

[1] https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contentdocument.htm
ZANE PRATERZANE PRATER
Certainly.  The custom object is a managed object (Apttus Agreement) This is a contract record that stores the contract attachment.  Once the contract attachment is activated it is converted as content in the content related list.  The Agreement Status field is then changed to 'Activated'.  It is at that time will trigger an email to send to a group of users a link to the content document.  I was hoping to accomplish this in a flow but am not able to bridge the object record id (parent if you will) back the content record so I can pass the content document id in a VF template.  Does that make sense.  Thanks for you help by the way.
ZANE PRATERZANE PRATER
I was able to get this to work through a flow.  I created a new field on the object that stores the contentid and is updated by a flow called by a process.  Then I pass the contentdocid var into my url path of a send email component.  Works like a charm.