15
Views
6
Comments
Solved
Edit data in data base using a form
Question

Hi everybody,

I am currently working on a Task manager and have the following problem:
I have implemented an option to edit an already created task. When you click on edit, you are able to view all the fields of the task and you can change the e.g. description. Then a implementer a SaveOnClick process, which should overwrite the existing data in the database with the updated information. But Somehow this doesn't work.
Does anyone know if this is possible and how?

Thanks a lot and best regards,
Raphael

 


Rank: #68
Solution

Hi Raphael,


You were just missing the filter on the query to get the task for the given TaskId as an input:


It's precisely to also show the present value that you should use the fields of the query.

I send you the OML in attachment to help you understand the changes.


Hope it helps.


Regards,
João

TaskManagerv3.oml

Rank: #403

Hi Raphael,

It would be good if you can share the OML with us for analysis and quick resolution.

Thanks & Kind Regards,

Sachin

Rank: #68

Hi Raphael,


The input you have is binded to a variable Taskname while you're sending to the database the GetKundensWithTasks.List.Current... record. They are not the same thing and that's why what you're changing is not the same of what you are saving.


The best way to fix this is to bind the input variables to the record attributes. So in your first image, your input variable would be GetKundensWithTasks.List.Current.Task.Name (I cannot see the rest but imagine the record is called Task and the attribute Name, you should adapt to your datamodel).


Hope it helps.


Regards,
João

Champion
Rank: #99

Hi,


I agree with Sachin, if you can share your OML it's better.

But, from some analysis from your prints, you are using input variables as fields in the form and you are using the record from the data fetch to update. So, don't seem to me that you are updating the correct data.

Try to map the record from the data fetch to your form and update it (I don't even know why you are sending the data as input variables if all that fields can be loaded from the data fetch).


But, I can be seing this wrong. So, if you can provide your OML would be great!


Thanks!


Best regards,

Ricardo M Pereira

Rank: #38235

Hi all,


thanks a lot for all of your replies.
The problem I had, when I used GetKundensWithTasks.List.Current.Tasks.TaskName in the input fields of my form, was that it didn't show the old/present value as soon as I opened the edit page. But my aim is that - as long as you don't make any changes - you can still see the old value.
Doing it the way I did with the input variable, I was able to match eg the right task name to the Task ID.
I hope this information helps. See the oml attached.

Regards

TaskManagerv3.oml

Rank: #68
Solution

Hi Raphael,


You were just missing the filter on the query to get the task for the given TaskId as an input:


It's precisely to also show the present value that you should use the fields of the query.

I send you the OML in attachment to help you understand the changes.


Hope it helps.


Regards,
João

TaskManagerv3.oml

Rank: #38235

Thanks a lot, that was exactly the fault!

Best regards, Raphael