I referred to this documentation. The description for IsMajorVersion
is:
"true if the document is a major version; false if the document is a minor version. Major versions can’t be replaced."
What exactly is implied by "Major versions can’t be replaced"?
I have a file in Salesforce with IsMajorVersion
true, inserted by this code:
public static void insertUpdatedDocument(List<ContentDocumentLink> documentLinks, Map<String, Blob> docData)
{
List<ContentVersion> contentVersions = new List<ContentVersion>();
for(ContentDocumentLink documentLink : documentLinks)
{
String documentId = documentLink.ContentDocumentId;
String documentName = documentLink.ContentDocument.title;
String documentType = documentLink.ContentDocument.FileExtension;
Blob versionData = docData.get(documentId);
ContentVersion cv = new ContentVersion();
cv.ContentLocation = 'S';
cv.ContentDocumentId = documentId;
cv.VersionData = versionData;
cv.Title = documentName+'.'+documentType;
cv.PathOnClient = cv.Title;
cv.IsMajorVersion = true;
cv.OwnerId = Label.Remote_Trx_DocumentOwnerId ;
contentVersions.add(cv);
}
insert contentVersions;
}
But I can upload a new version via the UI:
So what is that field really supposed to prevent?