Display Notifications

Hi All, I'm working on a project, where I need to get the notifications as per the entered Schedule. Eg. Like the Birthday notifications in the Facebook..I need the notifications 5days before the given date to display on the homepage.
2 answers

Notifications themselves are easy. Simply use the action 'show message', with a content of choice.

When to show them is the interesting bit. You say you need these messages to show on the homepage, five days in advance, so I take it we're looking at a dateTime variable here. I'll take your facebook birthday as an example.

The easiest way is to always open your homepage using a microflow. In this microflow, you retrieve the account for the user (which in your example should contain a date of birth). Use an exclusive split to check whether the difference between [%currentDateTime%] and Account/birthday is 5 days or less. If so; show message. If not, proceed as normal.


You can use an XPath for that. Take a look at the documentation here: https://world.mendix.com/display/refguide6/XPath%20day-from-dateTime First we need not the current date but 5 days before the current date. Create the variable DayToCheck and let this be addDaysUTC([%CurrentDateTime%],-5) Then create two lists. One using the Xpath [day-from-dateTime(Birthdate) = day-of-year-from-dateTime(DayToCheck)] The other list you do the same with the month: [month-from-dateTime(Birthdate) = month-from-dateTime(DayToCheck)]

The persons you are looking for are the persons that are in both lists. You can use the list operation intersect for that. See the documentation here: https://world.mendix.com/display/refguide5/List%20Operation

Good luck