Skip to content

Instantly share code, notes, and snippets.

@svierk
Created January 24, 2024 19:50
Show Gist options
  • Save svierk/ff464a634ef579e469a22a0a7a1e9dc2 to your computer and use it in GitHub Desktop.
Save svierk/ff464a634ef579e469a22a0a7a1e9dc2 to your computer and use it in GitHub Desktop.
Apex Class for Content Document Table Component | getLatestVersion
@AuraEnabled
public static string getLatestVersion(Id recordId) {
return [
SELECT Id, IsLatest, Title, ContentDocumentId
FROM ContentVersion
WHERE ContentDocumentId = :recordId AND isLatest = TRUE
WITH USER_MODE
LIMIT 1
]
.Id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment