poplooukhin-gmail
-
2/25/2014 4:08:33 PM
Versioning for instance of custom document type
Hi, all
I created a new instance of custom document type using Kentico API. After that, I try to get a version of this document: string where = "VersionObjectID =" + treeNode["DocumentID"]; //using treeNode["NodeID"] does not result for me too string orderBy = "VersionModifiedWhen DESC"; int topN = 1; DataSet versionDS = ObjectVersionHistoryInfoProvider.GetVersionHistories(where, orderBy, topN, null); if (!DataHelper.DataSourceIsEmpty(versionDS)) { // Get version ObjectVersionHistoryInfo version = new ObjectVersionHistoryInfo(versionDS.Tables[0].Rows[0]); return version.VersionNumber; } return string.Empty;
But I get version "1.1" instead of "0.1". If I update document (I can see a new values in updated document), then I will get version "1.1" instead of 1.1 + 0.1.
I always get version 1.1
I set: "Version history length (major versions)" to 0 "Version history length (major versions)" to 0 "Save to last version if younger than (minutes)" to 0 "Promote to major version if older than (hours)" to 24
Please, give me a sample code for getting version of instance of custom document type.
|