Activity Forums Salesforce® Discussions How do I create a contents document in Salesforce?

  • Aditya

    Member
    July 20, 2020 at 4:06 pm

    Hi,
    ContentVersion ContVerFile = new ContentVersion();
    ContVerFile.VersionData = Blob.valueOf('string');
    ContVerFile.Title = 'title';
    ContVerFile.ContentLocation= 's';
    ContVerFile.PathOnClient='title.csv';
    insert ContVerFile;

  • Ratnesh

    Member
    July 21, 2020 at 6:16 am

    Use the ContentDocument object to retrieve, query, update, and delete the latest version of a document, but not a content pack, in a library or a Salesforce file. You cannot insert ContentDocument directly, As soon as you insert ContentVersion, a ContentDocument get inserted behind the scene.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos