Creating a Save Button to save Changes from an Editable Table

Creating a Save Button to save Changes from an Editable Table

  

Hey, guys, I need some help on how to create a save button for an editable table. It's not as straight forward as most other saves.


When I assign the save to an employee ID in the table

I select the table as the Source for the server action createorupdate the records

and I get datatype is none.


Not sure how to save edits permantley to the database through the editable table.

Can share some print please? or if you want more help, PM

I am just not sure how to save information edited in an Editable table to the database. Hm

How are you populating the editable table? Is it from a aggregate or a structure you may make on the page?


What are you calling to save a record? And when you say pointing it at the table, are you pointing it to the entire table or the record that should be getting saved. We need a bit more information to properly troubleshoot your problem.

Jordan Welch wrote:

How are you populating the editable table? Is it from a aggregate or a structure you may make on the page?


What are you calling to save a record? And when you say pointing it at the table, are you pointing it to the entire table or the record that should be getting saved. We need a bit more information to properly troubleshoot your problem.


I am populating the editable table using an aggregate. 

I am attempting to save the whole table. I am pointing the save at the table, but it says it's not a data type. Should I point the save to the actual Combo Boxes? I can do that, I just figured there was a save just to save the page / table without having to point to each combo box in the table.


It's easy to save things that are in a Form Widget. Just this editable table is throwing me off on how to save it unless I just point the save at all the combo boxes themselves. The Editable Table uses Combo Boxes in each column.

So the table can't be saved as a unit, each line would have to be saved individually. There is no built in method to save an entire table.

Using the Edit table what you'd really want to do is set an action for the "On Row Save" event.

If you select New Action from there it will actually create it for you with an example implementation.

Each row is then saved after you are done editing it.

i have this example



What you can do is also have a boolean in the structure, and put onChange in the ComboBox receiving the line in question and the save button, you can have a for each with if and checking which are the lines that have the change made and if line has been changed, it does the CreateOrUpdate of the table in question

Thank you both for the help. I really appreciate it. I wish I could make you both as a solution to my answer.

The only problem I am having now is finding the source for the editable table. When I create a server action to save the data. It's asking for a source in the CreateOrUpdate action and I am not sure what to put as the source in the action since I do not have a Form.

It would be something like NameOfTable.List.Current.RecordType  You point it at the table.

Jordan Welch wrote:

It would be something like NameOfTable.List.Current.RecordType  You point it at the table.

SyntaxEditor Code Snippet

EmployeeOnLineTrainingTable.List.Current.EmployeeOnLineTraining

Like above? Since it's not a form. I just dont know what to point the CreateOrUpdate server action to inside the editable table since I dont have any forms. Should I create three CreateOrUpdate server actions within one Save action for each column in the editable table?

Solution

So the save action is for an individual line, and yes, I believe that Syntax would work. This way you would save as you went editing the table


If you wanted to create something that would save every row in the table with one button you could create a new action with a For Each loop on 

EmployeeOnLineTrainingTable.List

Then in the cycle put in a CreateOrUpdate action with 

EmployeeOnLineTrainingTable.List.Current.EmployeeOnLineTraining


You could think of an editable table as a widget with a List of "Forms". You do not need a form to update an entity.

Solution

Awesome, it's working. Thank you very much.


EmployeeOnLineTrainingTable.List.Current.EmployeeOnLineTraining


The line is saving the data to the table. Thank ya.