Contents
How to use CONTENTVERSION object in Salesforce?
Use 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. Use the ContentVersion object to create, query, retrieve, search, edit, and update a specific version of a Salesforce CRM Content document or Salesforce file.
Can a CONTENTVERSION be inserted into a contentDocument?
You cannot insert ContentDocument directly, As soon as you insert ContentVersion, a ContentDocument get inserted behind the scene. Use 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.
How to upload files using Apex code in Visualforce?
After DML on ContentVersion a new version of ContentDocument will be created for us in salesforce. The easiest way to do this is using inputFile and assign it to ContentVersion instance. Like this:
How to insert a content document in Salesforce?
STEP 1: Create a connect app in your target Org where you want to send a Content Document and insert it. After creating a connected app, we get Client_Secrete, Client_Id, UserID, and Password of the target Org for the callOut from the source Org.
How to create a CSV file from Salesforce?
2) create header row containing all coloumn names : 3) iterate your records and create strings from respective fields from records, depending on the above format add ‘ ‘ to each row. etc in for loop keep adding thses strings to final string. 4) created a blob object assign this content to blob send as attachment in mial or store as document.
When do I get the contentDocument object in Salesforce?
Don’t forget to check out: Salesforce Administrator Roles And Responsibilities. Firstly I would like to say that whenever any file is uploaded in the Salesforce CRM library or while uploading a file for any Record in its record page, we get the ContentDocument object in our org.