Skip to main content

GetLatestFileVersion

Gets the latest file version of the given file.

Syntax

// Assumes shellUI has been initialized with IShellUI instance
const results = await shellUI.Vault.ObjectOperations.GetLatestFileVersion({
file_id: {
type: 3 /* Enum: FileIDType */,
internal_id: 0,
external_repository_id: "<external repository id>",
},
allow_checked_out: false,
});

Message

NameDescriptionType
file_idFile ID as JSON. (represented by MF_FileID struct)FileID
allow_checked_outTrue if a file version of a checked-out document can be included if the document is currently checked out to this user. Note that even if this parameter is true, the method never returns a file version that is part of a document that is checked out to some other user.boolean

Return type

NameDescriptionType
file_versionThe latest file version ID.number
pobjverThe object version to which the requested latest file version belongs.ObjVer

Example

{
"file_version": 0,
"pobjver": {
"obj_id": {
"type": 0,
"item_id": {
"internal_id": 0,
"external_repository_id": {
"connection": "<connection>",
"item": "<item>"
}
}
},
"version": {
"type": 7 /* Enum: ObjVerVersionType */,
"internal_version": 0,
"external_repository_version": "<external repository version>",
"external_repository_sort_key": 0
}
}
}