0% found this document useful (0 votes)
31 views3 pages

Salesforce Part 3

In Salesforce, when a file is uploaded, a ContentDocument record is created, and for each new version of that file, a ContentVersion record is generated. The ContentDocument represents the file itself, while ContentVersion manages its various versions and associated metadata. Key fields include unique identifiers, file type, size, and version information, with the latest version indicated by the IsLatest field.

Uploaded by

heyayaan09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Salesforce Part 3

In Salesforce, when a file is uploaded, a ContentDocument record is created, and for each new version of that file, a ContentVersion record is generated. The ContentDocument represents the file itself, while ContentVersion manages its various versions and associated metadata. Key fields include unique identifiers, file type, size, and version information, with the latest version indicated by the IsLatest field.

Uploaded by

heyayaan09
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Files in salesforce

1)whenever file is Uploaded in salesforce Basically ContentDocument and ContentVersion is created.


ContentDocument Record is created only once when file is uploaded. Not when new version of file is
uploaded , in that case ContentVersion Record is created

ContentDocument:-
Certainly! The ContentDocument object in Salesforce represents a file that can have multiple versions (an each
version represented by ContentVersion records). Here are the important fields for ContentDocument
• Id :-
Unique identifier for the ContentDocument record.

• LatestPublishedVersionId
: The ID of the latest published version of the document. This field links to the most recent ContentVersion.

• Title
• : The title of the document. It usually matches the title of the latest ContentVersion.

• FileType
• : The type of the file (e.g., PDF, DOCX, JPG).

• ContentSize
• : The size of the document in bytes. It is the size of the latest version of the document.

• CreatedById
• : The ID of the user who created the document.

• CreatedDate
• : The date and time when the document was created.

• OwnerId
• : The ID of the user who owns the document.

ContentVersion:-
Whenever a file is uploaded or new version of same file is uploaded a record in ContentVersion is created.

The ContentVersion object in Salesforce is critical for managing file versions and associated metadata. Here are some important fields for
ContentVersion, along with their descriptions:

Important Fields for ContentVersion

1. Id
o : Unique identifier for the ContentVersion record.
o
2. ContentDocumentId
o : The ID of the parent ContentDocument object. This groups all versions of the document.
3. Title
o : The title of the file. It is typically the name you want to assign to the document.
o
4. VersionData
o : The binary data of the file. This is where the actual file content is stored.
o
5. PathOnClient
o : The file path on the client's machine from where the file was uploaded.
o

@salesforceExcellenceCourse
6. ContentSize
o : The size of the file in bytes.
o
7. FileType
o : The file extension (e.g., PDF, DOCX, JPG).
o
8. VersionNumber
o : The version number of the document (e.g., 1, 2).
o
9. IsLatest
o Description: Indicates whether this version is the latest version (true or false).
o
10. OwnerId
o : The ID of the owner of the version.
o
11. ReasonForChange
o : The reason for uploading a new version of the file.

Why Multiple ContentVersion of same file:- Every time ContentDocument and ContentVersion record is created
whenever new file is uploaded. But when new version of existing file is uploaded that time ContentDocument record is
not created but only ContentVersion Record is created.

Suppose file is already Upload to upload a new version of same file just open that file click on button as below to upload to
new Version of Existing file in that case new ContentVersion Record is created.
Changes in Record :-IsLatest is True for new ContentVersion record and false in old ContentVersion Record
and VersionNumber is maintained and ContentDocument record always Contain Latest ContentVersion record Id.

➔ ➔
--------------------------xxx-----------------------

-------------------------xxx---------------------------------xxxx---------------------------------------------

For more contact me and Complete SalesCloud HandMade Notes


Name :-Prakash

@salesforceExcellenceCourse
Telegram :-@salesforceExcellenceCourse

@salesforceExcellenceCourse

You might also like