Thursday, October 1, 2009

Get the version number of an IDfSysObject in Documentum using DFC

I was in a situation where I needed to get the version number of a document. Such as 1.0 or 2.6 etc...

Unfortunately Documentum only provides a repeating attribute called r_version_label. This attribute can contain other values such as CURRENT or other user entered values.

But the important thing to note is that Documentum always stores the version number in the first r_version_label value.

Based on this assumption you can retrieve the version number from an IDfSysObject using the following ...

IDfSysObject.getRepeatingString("r_version_label", 0);


Hope this is helpful.

2 comments:

Anonymous said...

Thanks for the post! Just a quick note - you can also write this so that you don't need to hardcode the r_version_label index:

String versionNum = mySysObject.getVersionLabels().getImplicitVersionLabel();

Joe Hopkins said...

Thanks tsgrp good observation.