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

Need Help in VBScript

Former Member
Former Member
' Get Contract End Date

Dim szContractEndDate

szContractEndDate = PropertyValues.SearchForProperty( 1306 ).TypedValue.DisplayValue

Dim szDate

szDate = DateSerial(Year(Now), Month(Now), Day(Now))

Dim szDate2

szDate2 = DateAdd("d",-135,szContractEndDate)

szDate = szDate2



I want to set  szDate2 to be trigger date for email notification
Parents
  • The last line will simply put szDate2 into your szDate variable - nothing gained by that.
    You should take a look at the DateDiff function www.w3schools.com/.../func_datediff.asp
    You can use it to determine whether sDate is equal to or larger than sDate2.
    And by the way: a simple use of the Date function should suffice - it is not necessary use the DateSerial function for this purpose.

    I suppose you want to use the script in a workflow transition trigger? If so you need to add a line "AllowStateTransition = True" if your requirements are met.
Reply
  • The last line will simply put szDate2 into your szDate variable - nothing gained by that.
    You should take a look at the DateDiff function www.w3schools.com/.../func_datediff.asp
    You can use it to determine whether sDate is equal to or larger than sDate2.
    And by the way: a simple use of the Date function should suffice - it is not necessary use the DateSerial function for this purpose.

    I suppose you want to use the script in a workflow transition trigger? If so you need to add a line "AllowStateTransition = True" if your requirements are met.
Children
No Data