This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Set Automatic Value For Date?

Former Member
Former Member
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?.
Parents
  • Former Member
    Former Member
    This is working fine in state's vbscript

    '--------------------------------
    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


    If you want to have a calculated value you may use this :


    '--------------------------------
    Function MsgBox(msg)
    Err.Raise MFScriptCancel, msg
    End Function
    '--------------------------------

    Output = DateSerial(Year(Now), Month(Now), Day(Now))
Reply
  • Former Member
    Former Member
    This is working fine in state's vbscript

    '--------------------------------
    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


    If you want to have a calculated value you may use this :


    '--------------------------------
    Function MsgBox(msg)
    Err.Raise MFScriptCancel, msg
    End Function
    '--------------------------------

    Output = DateSerial(Year(Now), Month(Now), Day(Now))
Children
No Data