Hi Everyone,
My Question is very simple ;
I have a propery field called = "Document Date" is it possible to set its value to something like "DateAndTime.Now" by a VBScript?.
[...]
' Create new property value.
Dim oPropertyValue As MFilesAPI.PropertyValue = New MFilesAPI.PropertyValue
oPropertyValue.PropertyDef = 1096 ' In this case, represents the "Effective through" property
oPropertyValue.TypedValue.SetValue(MFilesAPI.MFDataType.MFDatatypeDate, DateSerial(2015, 1, 1))
' Modify the object. The object needs to be in checked out state.
oVault.ObjectPropertyOperations.SetProperty(oObjectVersionAndProperties.ObjVer, oPropertyValue)
'--------------------------------
Function MsgBox(msg)
Err.Raise MFScriptCancel, msg
End Function
'--------------------------------
Const IPropDate = 1069
Dim oPropertyValue : Set oPropertyValue = CreateObject("MFilesAPI.PropertyValue")
oPropertyValue.PropertyDef = IPropDate
oPropertyValue.TypedValue.SetValue MFDatatypeDate, DateSerial(Year(Now), Month(Now), Day(Now))
Vault.ObjectPropertyOperations.SetProperty ObjVer, oPropertyValue
'--------------------------------
Function MsgBox(msg)
Err.Raise MFScriptCancel, msg
End Function
'--------------------------------
Output = DateSerial(Year(Now), Month(Now), Day(Now))
Can setting the current date be done without code? We are cloud based and cannot apply vbscript to workflows.
© 2025 M-Files, All Rights Reserved.