Update all rows in table record

  

I have a TableRecord, and I want to be able to Update a field in all the records with a specific value, which will be entered, either in a web block in the same screen, or on a new screen.

How can I do this?


Thanks,


Marios

Hello Mario,

Depends. Do you want to the change to be persistent in the database, or change only the data in the screen?

In the first case, use an Update in a SQL statement, that have a WHERE clause that matches the records you are retrieving from database to show in the Table Records. 

In this case, you need to be careful if you are using pagination and don't want to change all the records but only those visible. In this case, you can construct a list of ID's and pass to the SQL, instead, to be used in an IN clause.

If you want to change ONLY the rows in the screen, than you have to iterate the Table Records list and change the attribute directly into it, and Ajax Refresh line by line using the Row property of Ajax Refresh, or you change in the SOURCE list, without doing a Data Refresh, and than execute an Ajax Refresh in the Table Records.

Don't know if there are an easier way to do this.

Cheers.

Hi Marios,

can you post a screenshot on what you want to achieve. also you can try to put pop-up link next to the field you want to update, pass the Id of that record from your table record then run update logic on your pop-up, then on notify refresh the table record.

Cheers,

Julius

Hi Julius,


On this screen, I want to be able to mass change e.g. all Expiration Dates. A link that opens a pop-up window with a textbox and a "Save" button. When the button is pressed I want to update all records with the value entered in the text box.


Marios


Marios Tofarides wrote:

Hi Julius,


On this screen, I want to be able to mass change e.g. all Expiration Dates. A link that opens a pop-up window with a textbox and a "Save" button. When the button is pressed I want to update all records with the value entered in the text box.


Marios


The way to update in database is like I said earlier.

The way to refresh it in the screen is just send a Notify in the action in the popup, and in the OnChange, data refresh the source aggregate and ajax refresh the table records in the parent window.

Or am I missing something you need?

Cheers


Solution

Marios Tofarides wrote:

Hi Julius,


On this screen, I want to be able to mass change e.g. all Expiration Dates. A link that opens a pop-up window with a textbox and a "Save" button. When the button is pressed I want to update all records with the value entered in the text box.


Marios


Hi Marios,

can you try this solution.

1. click the expiration date and pubdate, try to update the fields.

2. optional to apply all or by specific row of your table record.

https://jdelorino.outsystemscloud.com/test/


Cheers,

Julius

Solution

Julius,


Can you attach the oml file for me to see how you did it?


Thanks,


Marios

Marios Tofarides wrote:

Julius,


Can you attach the oml file for me to see how you did it?


Thanks,


Marios

Hi Marios,

kindly see the attached file. feel free to modify the solution to suit your requirement.


Cheers,

Julius


I can't mark two posts as solutions, so THANKS Eduardo and Julius for your help.

I managed to do it with your tips and Julius's .oml file!

Thanks again!

Marios


Welcome Marios, Happy to help.