Hello friends, I created a system to manage my company’s vehicle fleet.
However, I need to send an email to a list of users when the vehicle reaches the maintenance date.
Basically, I need the backend workflows to check the current date and compare it with the date that was released for maintenance. When it reaches 15 days before maintenance, an email must be sent to the users responsible for this.
The same needs to happen when you reach the maintenance mileage (or miles).
I managed to create a visual element for this on the dashboard, but I need to notify users who have not entered the system.
I’ll leave an image of how I did this in the visual element.
In the image above, the green ball says that maintenance is up to date, yellow requires attention as maintenance is approaching and red means when maintenance is due.
here are the conditionals I used for this visual element.
Brazilian greetings
Hey Leandrot
best way to do this would be to have a backend workflow, that has the action to send the email to the list of users
When the maintenance date is set, you will schedule this workflow for the maintenance date + days “-15”. When schedule this workflow, save the workflow ID to the vehicles data type. (this will be needed soon)
Then have a database trigger with an condition like this, "vehicles before change maintenance milage < vehicles after change maintenance mileage’
Then in this workflow, you want to have the action “schedule a cancelled workflow” and use the ID you saved previously, then schedule the same workflow (for the bulk email), for the current date/time.
This should work assuming you update the maintenance miles and the date every time its serviced
Hello bodiebloore, thank you very much for your help. But I’m not able to do it.
For me, the option to schedule a canceled workflow does not appear.
Just to explain a little how my database is modeled, I have a table called “vehicles” that updates the miles whenever the user uses the vehicle, I created another table called “vehicle maintenance”, in this table the user who registers maintenance inserts all service data, such as value, current miles, miles for the next maintenance, execution date, next maintenance date, etc.
As the miles are always updated and I already have the next mile and maintenance date in the maintenance table, isn’t it possible to create a trigger that only monitors the miles and compares?
Another very important thing, I have more than one scheduled maintenance for the same vehicle on different dates and miles.