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

Server Time - Workflow Based Notifications Send Time

Former Member
Former Member
Good day Community,

We have a unique scenario with a clients workflows and thought it might be a good idea to plug into the community to see if anyone has solved this before or has a starter point for the script that we may require.  I'd hope we aren't the first to run into this.

There are two parts to this scenario. Firstly the server has a set time for Daily Digest emails of 9:00 AM.  This also impacts any notification rules, built in the Desktop Client, one that use a Date value within the Define Filter, withholding them until 9:00 AM.  This is perfect, sending these out during the clients business hours.

We have also been building various workflows for this client and have noticed that on one workflow which utilizes the DayFrom() function, with a Date Property. That the workflows built in notifications, the ones on certain Events are triggering between 12:00 AM and 01:15 AM.  This makes sense as the server clocks kicks over to the next day, and the property matches the Define Filter conditions of the trigger, the one set before the workflow State containing the notification settings.  Unlike the Notification Rules, these do not appear to be governed by the Digest message time setting in the Admin Console thus they are sent out immediately once matching.

Could a script in the State Transition trigger resolve this?

Or should we script a Precondition on the State with the notification Action?

One concern we have is that if its a Precondition, would it sit on the server until the specified time frame, or would it be prompting the server constantly to complete that action?  Wouldn't want to bog the server down unnecessarily.

Please let me know if you have any suggestions or thoughts regarding this scenario.

Thanks
Parents
  • Former Member
    Former Member
    Hello All

    From what I've tested and used I haven't been able to get a system in place that will send notifications from a workflow at a certain time. I've only managed to delay the send time to be after a certain hour of the day. People were getting annoyed at getting emails at 1am in the morning. Below is the code that I have on an automatic state transition:

    Option Explicit

    Dim sStartDate
    sStartDate = PropertyValues.SearchForProperty( 1247 ).TypedValue.DisplayValue
    Dim sEmailTriggerTime
    sEmailTriggerTime = "15:00:00"
    Dim AgendaEmailSent
    AgendaEmailSent = PropertyValues.SearchForProperty( 1629 ).TypedValue.DisplayValue

    'If the difference between now and the start date is = 1 day and the difference between now and 3pm is
    If (DateDiff("d", Now , sStartDate) = 1) And (DateDiff("n", Time , sEmailTriggerTime )
    AllowStateTransition = True

    Else
    AllowStateTransition = False
    End If


    I've got some extra conditions in there that are particular to my situation but the main one is:

    (DateDiff("n", Time , sEmailTriggerTime ) 


    In this case the state transition happens some time after 3pm. It's not real specific but I've found that is generally happens within 45 minutes.

    Hope this helps.
Reply
  • Former Member
    Former Member
    Hello All

    From what I've tested and used I haven't been able to get a system in place that will send notifications from a workflow at a certain time. I've only managed to delay the send time to be after a certain hour of the day. People were getting annoyed at getting emails at 1am in the morning. Below is the code that I have on an automatic state transition:

    Option Explicit

    Dim sStartDate
    sStartDate = PropertyValues.SearchForProperty( 1247 ).TypedValue.DisplayValue
    Dim sEmailTriggerTime
    sEmailTriggerTime = "15:00:00"
    Dim AgendaEmailSent
    AgendaEmailSent = PropertyValues.SearchForProperty( 1629 ).TypedValue.DisplayValue

    'If the difference between now and the start date is = 1 day and the difference between now and 3pm is
    If (DateDiff("d", Now , sStartDate) = 1) And (DateDiff("n", Time , sEmailTriggerTime )
    AllowStateTransition = True

    Else
    AllowStateTransition = False
    End If


    I've got some extra conditions in there that are particular to my situation but the main one is:

    (DateDiff("n", Time , sEmailTriggerTime ) 


    In this case the state transition happens some time after 3pm. It's not real specific but I've found that is generally happens within 45 minutes.

    Hope this helps.
Children
No Data