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

Notification setup - 1st day of each month

Hi! Does anybody know how to setup a notification to be sent to a user on the 1st day of each month?

As i want to customise the notification I setup a workflow with 1 state only for this.

Basically on the 1st day of each month the workflow is triggered and sends a link to a view to a user.

Any ideas?

Many Thanks,

Nuno

Parents
  • HI Nuno,

    I found a way to do this. I will try to explain it here as well as I can. If anything is unclear, please ask.

    I created a Date property definition named "First Day of Next Month" and gave it an automatic value using Calculated Value (VBScript) with the following code.

    Output = DateSerial(Year(Date), Month(Date) + 1, 1)

    This value will be updated whenever the object is modified.

    Then, I created a simple workflow, the automatic state transition happens when the DaysFrom "First Day of Next Month" = 0

    In the "Send Notification" state, you configure the notification you wish to send and then add the following code to Run Script on the Action Tab (make sure to use the correct Alias for your "Pending First Day of Month" state:-

    Option Explicit

    Dim PendingFirstDayOfMonthWFStateID : PendingFirstDayOfMonthWFStateID = Vault.WorkflowOperations.GetWorkflowStateIDByAlias("WFS.SendNotificationOnFirstOfMonth.PendingFirstDayOfMonth")
    Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")

    oPropVal.PropertyDef = 39 ' Workflow states build-in property

    oPropVal.TypedValue.SetValue MFDatatypeLookup, PendingFirstDayOfMonthWFStateID

    Vault.ObjectPropertyOperations.SetProperty ObjVer, oPropVal

    What should happen is that you created your object and the "First Day of Next Month" gets set. When the first day of the month arrives, the automatic state transition happens. This will send your notification, recalculate the "First Day of Next Month" value and the Script will return the object to the "Pending First Day of Month" state.

    Please test this before using it in your production environment.

  • Hi David,

    Thanks you so much for your reply.

    I did something similar but there's a detail on this (and I should have mentioned...). I have no object related with the notification. It pretends to be a reminder email notification only.

    What happens is that we do have a process in place managed by a workflow that is doing this. Each 1st day of every month is triggered, changes the object state to Ongoing and sends the notification. The problem is that they are receiving 1 notification per object and their email box is flooded by emails on those days.

    They have asked if they could have only one notification (with a link to the ongoing view).

    I've checked the Notifications thinking that I could set something there, but didn't find a way... that's why I setup a simple workflow that triggers a notification for that group as a reminder.

    Hope you understand what I'm trying to achieve.

    Many Thanks,

    Nuno

  • Hi Nuno,

    Thanks for your quick reply.

    I did not mention that I was using this workflow with a new object type I created called "Notification Object" which just has the "First Day of Next Month" property.

    If it is truly just one view that they need to be notified for, you can set the details of the view in the Send Notification properties of the Send Notification state.

    If you wanted to reuse this object for other things, you would need to add other properties to the object which you could then refer to my property ID in the Send Notification rule.

    I can't see any way for you to use the built in Email Notification functionality for your use case.

Reply
  • Hi Nuno,

    Thanks for your quick reply.

    I did not mention that I was using this workflow with a new object type I created called "Notification Object" which just has the "First Day of Next Month" property.

    If it is truly just one view that they need to be notified for, you can set the details of the view in the Send Notification properties of the Send Notification state.

    If you wanted to reuse this object for other things, you would need to add other properties to the object which you could then refer to my property ID in the Send Notification rule.

    I can't see any way for you to use the built in Email Notification functionality for your use case.

Children