Activity Forums Salesforce® Discussions How can we get a sharing link from 'files/content' from Salesforce apex?

  • Prakhar

    Member
    September 8, 2016 at 12:33 pm

    Hi Mohit,

    According to your question, you want to get the sharing link of the document which is being saved in file object as a "Content Document".

    In this case you can get the sharing link from "ContentDocumentLink" object which is a junction object between ContentDocument and file where it is shared of the content version of the document which is saved with the help of the query below:

    select id from ContentDocumentLink where ContentDocumentId = '(Id of the content document)'.

    For information about contentdocumentlink please click on the link.

    Thanks.

  • Avnish Yadav

    Member
    September 30, 2018 at 5:15 am

    Hello,

    Use the ContentVersion-

    List<ContentVersion> listDoc = [select id, Title, Description from ContentVersion];

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos