Skip to main content

GetLatestObjectVersion

Gets the latest document version of the given document.

Syntax

// Assumes shellUI has been initialized with IShellUI instance
const results = await shellUI.Vault.ObjectOperations.GetLatestObjectVersion({
obj_id: {
type: 0,
item_id: {
internal_id: 0,
external_repository_id: {
connection: "<!< The external repository connection identifier.>",
item: "<item>",
},
},
},
allow_checked_out: false,
});

Message

NameDescriptionType
obj_idThe object ID.ObjID
allow_checked_outTrue if a checked-out document version can be returned if the document is currently checked out to this user. Note that even if this parameter is true, the method never returns a version that is checked out to some other user.bool

Return type

NameDescriptionType
object_versionThe latest document version ID. It can be a checked-out version only if the current user has this document checked out.ObjVerVersion
version_guidThe GUID of the document version.string

Example

{
"object_version": {
"type": 7 /* Enum: ObjVerVersionType */,
"internal_version": 0,
"external_repository_version": "<external_repository_version>",
"external_repository_sort_key": 0
},
"version_guid": "<!< The GUID of the document version.>"
}