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
  • Joonas' suggestion is much simpler to create and maintain than scripting. Scripts should only be used when no simple built-in solution are available.
    State transition ruled by a date can be achieved in a way similar to what Joonas described for notification. No scripts needed for that type of action.
    As this post unfolds it becomes obvious that one should explain the goal before going into details with the solution. There might be a much simpler way to achieve the goal than the one we first think of.
  • Former Member
    Former Member
    Yes I agree and i'd like to apologize as well for jumping into a conclusion.

    Yeah probably will do the built in one. I just have an additional question.

    On my mfiles it shows (please see image). I'm not sure if i'm doing it correctly. I tested it and put Nov 15,2020 on Contract End Date, if we count back today is 60 days before Contract End Date but i didn't receive any notification.

  • You need to be careful when selecting DaysFrom or DaysTo!
    You would be better off to use = if relevant) than just =
    Finally you should be aware of the timing set for digest notification. It may be set for later in the day. I generally tend to set it for 07:00 or something like that to get them out by morning but still make sure all relevant events from the night will be included.
  • And just for clarity: notification rules can be configured as common rules by the admin so end users don't need to do anything regarding them, they will just start receiving these notifications if they are in the recipient group.
  • Former Member
    Former Member
    I'll test everything you advised and navigate other notification in Mfiles Admin. Ill give you a feedback.

    Thank you , appreciate your help.
  • Former Member
    Former Member


    Its working now. I've put the condition on workflow transition state.

    Thank you so much for all your help.