Problems with List Records

Problems with List Records

Hello. I'm new with OutSystems Service Studio and I'm building a personal blog in order to get used to this platform.

I have two entities: Post and Comment (comment has a foreign key to PostId). When a user is reading a post, he has the option to read the comments and to delete them. But in this last option there is a problem. If I have, for example, three comments:

comment 3: hello
comment 2: hy
comment 1: nice blog!

When I select the delete option for comment 3, it deletes comment1! Then, if i select the delete option for comment 3, it will delete comment 2.

I'm using a List Record widget to display the results and I'm using an action to delete the comments. That action has a parameter that is assigned with ListRecord1.List.Current.Comment.Id (I think).

But, If I choose the value of the action parameter to be GetComments.Current.Comment.Id (GetComments is a query made in the preparation action in order to get the comments of the respective post), de delete action gos fine till I reach the last comment. When I click to delete the last comment, I occurs an error.

Why is the delete option behaving like this?

Any help will be welcome.

Thank You,

Hi Filipe,

Welcome to out community! Hope you enjoy using the OutSystems platform.

Regarding your question, the correct way of referencing the selected comment would be using ListRecords1.List.Current.COMMENT.Id. You don't even need to add a parameter for it - you can use it directly on the screen action.

GetComments.Current.Comment.Id will NOT work for selecting the correct row - you should reference the list record on your screen action. This is actually a common mistake for beginners - I did it myself once. :)

In attach I'm adding a sample eSpace that you can try for yourself, if you have any doubts.

Paulo Ramos
It is possible a higher version of eSpace?

Hi Vera,

Here it is, already upgraded for 4.2. I hope it helps. Sorry for the trouble, and thanks for bringing it up.


Paulo Tavares
Hi Paulo.

I hope this helps.