Using calculated field value in list widget as a link

Using calculated field value in list widget as a link

  

I have added an aggregate in a screen preparation. In the aggregate I have added two calculated fields "Edit" and "Delete". I want to create a link on these two values to go to a screen for editing the record or popup an "Are you sure?" dialogue and if "Yes" delete the record. In the list widget, however, the only fields it seems to allow come directly from the database entity. I'm using the latest version of Outsystems. I'm sure I saw in a tutorial a technique to accomplish this task in Outsystems 9.x, but I can't seem to find anything about it in the current courses.


P.S. I am developing a web application.

Hi Steve,

You don't need to create Calculate Fields for this.
Just add directly to the List Records in the screen a text "Edit" and another "Delete". Around each one, put a link. One that points to the Detail screen, the other that opens your popup to confirm the Delete.

You just need to have Input Parameters for the record ID on each page (the Detail and PopUp), and pass the List1.List.Current.Id (that will be defined when the user click in one of the links.

By the way, you can use the default confirmation window just adding a confirmation message to the Delete Link, and calling an action to delete the record (passing the id or using the List1.List.Current.Id inside your action). The action will be called only if the user press ok.

Hope this helps.

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hi Steve,

You don't need to create Calculate Fields for this.
Just add directly to the List Records in the screen a text "Edit" and another "Delete". Around each one, put a link. One that points to the Detail screen, the other that opens your popup to confirm the Delete.

You just need to have Input Parameters for the record ID on each page (the Detail and PopUp), and pass the List1.List.Current.Id (that will be defined when the user click in one of the links.

By the way, you can use the default confirmation window just adding a confirmation message to the Delete Link, and calling an action to delete the record (passing the id or using the List1.List.Current.Id inside your action). The action will be called only if the user press ok.

Hope this helps.

Cheers,
Eduardo Jauch

Thank you for the quick reply. I'm still very much learning Outsystems development. How do I specify the default confirmation window as the destination in the link? 


Steve Sommers wrote:


Thank you for the quick reply. I'm still very much learning Outsystems development. How do I specify the default confirmation window as the destination in the link? 


No problem :)

The idea is to set the link to a Screen Action, that will delete the record.
To enable the default confirmation popup, just select the link and type your confirmation message in the property Confirmation Message.

If it is empty, the action is called.
If you set a message, the confirmation popup will appear and the action will be called only if the user press the Ok button.

Cheers,
Eduardo Jauch

EDIT:

Solution

I forgot to say.

If you type "Delete" and click with the right button of the mouse on it to open the context menu, one of the options will be to create a link to an Action. The action will have the logic to delete the record and will set the message and every thing else. At least on a Table Records (Don't know if it works on List Records)

Regarding the "Edit", usually we don't create a field with Edit. We just add a link around something meaningful in the line, even the #Id if there is nothing else, and point to the Detail screen.

And by the way...

If you drag an entity to the Flow (like MainFlow), Service Studio will create a List page for you. If you drag it again (to the MainFlow), it will create a Detail page, and do the link between those two pages :)

Cheers,
Eduardo Jauch

Solution

Eduardo Jauch wrote:

I forgot to say.

If you type "Delete" and click with the right button of the mouse on it to open the context menu, one of the options will be to create a link to an Action. The action will have the logic to delete the record and will set the message and every thing else. At least on a Table Records (Don't know if it works on List Records)

Regarding the "Edit", usually we don't create a field with Edit. We just add a link around something meaningful in the line, even the #Id if there is nothing else, and point to the Detail screen.

And by the way...

If you drag an entity to the Flow (like MainFlow), Service Studio will create a List page for you. If you drag it again (to the MainFlow), it will create a Detail page, and do the link between those two pages :)

Cheers,
Eduardo Jauch

Thank you. That's much clearer than mud. I especially like the trick in your last sentence.