Hi all,I'm currently working on a Task Management. When the deadline of a task has passed, its status should turn into "Deadline passed". The Task Manager should check every night, if the deadline has passed or not.
I built a logic for that. My problem is, to implement the logic into a timer. I select the logic in the field "Action" and want to select all tasks of the database in the field "Tasks". But I'm stuck doing it, because it gives me error messages all the time.Here you can see my logic "Change_Status" and in the right column the fields of the timer.
Thanks a lot for your help and have a great day.
Hi Raphael,
You can create other action between the timer and the change status action.
This new action should not have any input parameters. There you can query the takss, create a foreach and for each task call the change status action.
King regards,
Plácido
Hi,
You can make an SQL advanced were you select all tasks with the deadline passed (need to see if you need more filters because of all conditions, p.e. the previous status) and updated them all for the new status. With this you perform a bulk operation that is much more eficient that the foreach iteration.
With that you don't need to make more code in your action that the timer is running and don't need input parameters.
Hope this can help!
Best regards,
Ricardo M Pereira
Here is my suggestion.
1 - Create task and status tables (you should already have)
2 - Create a "ChangeStatusDeadlinePassed" server action. In this server action you will only get delayed tasks with a status other than "deadline" and update status for "past deadline"
3 - Create a stopwatch once a day
Thanks a lot for your detailed answer. I did it the way you explained. But in the server action, I can only have GetDelayedTasks.List.Current.Tasks as source. If I try using GetDelayedTasks.List.Current.Tasks.Id, it shows the error message "'Tasks' data type required instead of 'Tasks identifier'".Do you know why I can't have the id as source in my case?
When an action is expecting a record, you can also define its attributes since a record is a set of attributes and its values. In order to do specify the value of each attribute of a record as done in Alexandre's example, you need to expand the source by hovering the left space behind Source and clicking on the + sign it will appear, as on the image below:
Regards,João
Raphael,
Could you send me the code?
Attach the oml file.
see attached. Thanks a lot
Please, check the the action change_status2.
You do not need pass a task into input parameter because this method works for all tasks.