Delete table record with confirmation popup removes the last record
Question
Application Type
Reactive

I've a table with items where I want the user to confirm a deletion with a popup screen (I've created own modal window). After clicking the delete button in the popup, the last item of the table is consequently removed, and not the item in the chosen tablerow. I've struggled through the forms and tried several assignments in the logic, but it's still not working. I've tried it also with the standard confirmation option in the button, but same problem.

Does anyone know of a working example for a reactive webapp?

Solution

With my first answer, it was the correct answer.

What you were missing was passing the id of the document when showing the popup. You did one thing right, was storing the id of the document selected to delete, but when deleting you were using the aggregate variable.

Now you are just using the documented variable.


And you can delete

https://marcio-carvalho4.outsystemscloud.com/Documents/Documents?_ts=637672422568551168

I also had to change the input on server action to delete

I will share the OML

Kind regards,

Márcio


Documents.oml

Try to see if you are passing the right id to delete. Did you use the debugger? That will help you for sure.

I already had some problems where I wasn't passing the right id and why that? because when clicking on an item on the table using the aggregate id variable it was always passing just the first because it was not connected to the table, the popup. So, what you need to do is when clicking on an item of the table to open the popup you need to be sure you are storing the right record, the right id on a variable apart from the aggregate, to be sure you are using/deleting the right record.

Let me know if it helped you.

If not you could share your oml to see the error it would be great, if you cannot share, can you replicate the issue on another oml and share?


Kind Regards,

Márcio

Hi Márcio,

I've added oml file. I've put in the actions some messages with Id or Name. Initially in the popup it seems going correct, but at the last step (deleting the item), it deletes the wrong Id. Hope that you can help me out.

Documents.oml

Solution

With my first answer, it was the correct answer.

What you were missing was passing the id of the document when showing the popup. You did one thing right, was storing the id of the document selected to delete, but when deleting you were using the aggregate variable.

Now you are just using the documented variable.


And you can delete

https://marcio-carvalho4.outsystemscloud.com/Documents/Documents?_ts=637672422568551168

I also had to change the input on server action to delete

I will share the OML

Kind regards,

Márcio


Documents.oml

Thx. It works now!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.