Increase Document version value

Hello, 

could anybody be so kind and could help me with this little issue? I need to write a little script which should increase the number of document version by one. But I am getting error: Obejct required: [string: "1"]  for row: Dim oVersion: Set oVersion = PropertyValues.SearchForProperty( iPDVersion ).TypedValue.DisplayValue

What am I doing wrong here? 

My code:

Dim iPDVersion: iPDVersion = Vault.PropertyDefOperations.GetPropertyDefIDByAlias("PD.Version")
Dim oVersion: Set oVersion = PropertyValues.SearchForProperty( iPDVersion ).TypedValue.DisplayValue


Dim oPropValNew: Set oPropValNew = CreateObject("MFilesAPI.PropertyValue")
Dim oPropValsNew: Set oPropValsNew = CreateObject("MFilesAPI.PropertyValues")

oPropValNew.PropertyDef = iPDVersion
oPropValNew.TypedValue.SetValue, oVersion + 1

oPropValsNew.Add -1, oPropValNew


Thank you! 

Top Replies

Parents Reply Children
No Data