You need to sign in to do that
Don't have an account?
Sylvie Serplet
Retrieving LinkedEntityId via SOQL to update a custom field on ContentVersion
Hi All,
I am trying to create an Apex Trigger to update a custom field on Files (ContentVersion object) with the LinkedEntityId (ContentDocumentLink object).
Any idea how to do it?
Thank you in advance for your help.
Sylvie
I am trying to create an Apex Trigger to update a custom field on Files (ContentVersion object) with the LinkedEntityId (ContentDocumentLink object).
Any idea how to do it?
Thank you in advance for your help.
Sylvie
SELECT ContentDocument.title ,LinkedEntityId FROM ContentDocumentLink WHERE ContentDocumentId = '069D00000000so2' AND LinkedEntityId = '0D5000000089123'
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentdocumentlink.htm?search_text=LinkedEntityId
Thank you for your response. I got the idea.
What I am trying to achieve is retrieving the ContentDocumentId and the LinkedEntityId from a File in order to update a custom field on the same File. To do so I have to build a query with several levels of parent, child relationships. And I am not sure how Content Document, Content Version and Content Document Link are related to each other in order to build the SOQL. Cannot really find any documentation.
Thank you in advance for your help.
Sylvie