Prepopulated data in database

0
Hi, I have a requirement where I have to set a prepopulated data like thought for the day/month, and each day/month it will be populated from the database to the site automatically.How to achieve this in mendix?
asked
2 answers
0

Hi,

The title for the thread is little misleading however for your case, you can try the following.

1. Create an Entity in your domain model named "Thoughts". Attributes - DisplayDate(DateTime type), Message(String type)

2. Now you can create objects of this new entity from the front-end by creating DataGrid, New/Edit pages and add the data. Have this functionality hidden from Users but only to Admin.

3. In the User's page add a DataView with source as Microflow. Retrieve the "Thoughts" object (not list but "first") with xpath [DisplayDate = '[%BeginOfCurrentDay%]']

 

Hope this helps.

answered
0

Make a microflow where you do all the create actions. Create a date variable where you begin for example with dateTimeUTC(2018,1,1). Create your object and set it with that variable. Then use the addDays function to add one day to the variable to create the next object. Use a loop for that where you check if the year is still 2018. This way you can create a year entity that holds all the days of that year.

Regards,

Ronald

[EDIT]

You might also check this module: https://appstore.home.mendix.com/link/app/56423/Bizzomate/Bizzomate-Holidays

 

answered