In the content version, there is a Last Modified Date that populates both the date and time, so I created a custom field called Last_Modified__c with a field type Date that is set to create only date not time.
Now I need a trigger that populates the last modified date, & not the time in Last_Modified__c based on the LastModifiedDate field in the content version.
trigger updateLastModifiedField on Last_Modified_Date__c (after insert) {
List<ContentVersion> LastModifiedToUpdate = new List<ContentVersion>();
for(Last_Modified_Date__c cv: Trigger.new){
if(nt.ParentId != null && nt.ParentId.getSObjectType() == schema.ContentVersion.sObjectType){
ContentVersion cv=new ContentVersion(Id=cv.parentId,RecentNoteContent__c=cv.Body);
LastModifiedToUpdate.add(cv);
}
}
if(!LastModifiedToUpdate.isEmpty()){
update LastmodifiedToUpdate;
}
}
{}
button to format it so it shows up nicely.