Hey! So, I am working on a app to track my tasks and it says the Custos (cost), when i started, when I finished it, the time that I used and a bunch of other information.
But, when I create a new task and update it , it changes both dates and Custos of my 2 tasks when I only want to change the one that I updated.
You can see that "Duração da tarefa"(DataFim) should be 2 but it is 4, for exampleHope you can help me, if you want, my OML file is on the comments
you need to filter again by the id in the pics and modify your assigns and SQL
My OML
asked and answered
https://www.outsystems.com/forums/discussion/67239/my-database-is-changing-all-data-instead-of-only-one/#
But I didn´t understand and I need another explanation, I asked for help once again
Hi Goncalo,
in the db you are saving correct and also in the ui, did you fixed already?
Hey! My problem is that when I update a task attribute (Custos or DataFim) it updates ALL the attributes of ALL tasks instead of only the task that I updated. If you change the task state ("A fazer.." to "Feito"), it changes EVERY attribute
you should have a filter here, to filter by the id of the record you want to update.
what is happening here is,
you have a loop that is passing per all records in this table, and in the pic you want to pass or in the record 9 or in the record 8 but you dont have a filter so will pass in all and make the update
when you enter in the flow of OnChangeOrderTask you are passing here as many times as records you have in the list, in the example above you will pass here for record 8 and record 9, updating the values in both
Solution:
Filter by id, modify your app to pass the id when you are moving the tasks and use the id as in the pic, and as you will not need the loop you can also remove it
and inside the flow of OnChangeOrderTask you shoud deal with the filter or pass as the input parameter the record you filter in the flow before that(in this case you must update the records before pass it).
if you are want to update the orders in all records, you should make a query that update just that cuz in this flow you are updating data for all records
PS: in the photo above is just your action no mods
Hey Carlos, I am sorry but I didn´t understand the second part
This one "and inside the flow of OnChangeOrderTask you shoud deal with the filter or pass as the input parameter the record you filter in the flow before that(in this case you must update the records before pass it).
if you are want to update the orders in all records, you should make a query that update just that cuz in this flow you are updating data for all records"
Can you explain it in other words or post some prints, maybe?