API
Version 7.x > API > SelectNodes and retrieving the latest version of a document View modes: 
User avatar
Certified Developer v6
Certified Developer v6
Dave - 6/20/2013 1:52:09 PM
   
SelectNodes and retrieving the latest version of a document
Hi,

It looks like we can use the following code to get the latest version of a document (published or unpublished):

var version = this._versionManager.GetLatestDocumentVersion(node.DocumentID);

var latest = this._versionManager.GetVersion(version, node);

Is there a way to use TreeProvider.SelectNodes to get the latest versions of a set of nodes?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/20/2013 9:58:24 PM
   
RE:SelectNodes and retrieving the latest version of a document
Hi,

Yes, it is possible but you will need to use VersionManager together to specify the version number you would like to get.

Also, to work with documents under workflow you can use GetDocument or GetDocuments methods from DocumentHelper class.

Best regards,
Juraj Ondrus