Inserting data in two different tables in one server action

Inserting data in two different tables in one server action

  

Hi,

I have created two different entities. A and B. In these entities I have different attributes like Ax, Ay, Az and Bx, By, Bz

On one single web page, I am displaying A's attribute in form and B's attributes in an editable table. I have a submit button to save the updated A's data and B's data. On the submit I have to do server action which will save data for both the entities. But somehow the value is not getting saved for B but for A it is getting saved.

Hi Neha,

An Editable Table is used in situations where you want to be able to update and save on a per-row basis. You specify the Screen Action that must save the row in the On Row Save property of the Editable Table.

Of course, if you really must, you can implement a "single save" approach, but I would argue against it on usability grounds.

That said, I would advise you to debug your application to see what goes wrong. Note that for both the Editable Table and the Form you need to use the Record List / Record of the Widget, not the original record or list.

Kilian Hekhuis wrote:

Hi Neha,

An Editable Table is used in situations where you want to be able to update and save on a per-row basis. You specify the Screen Action that must save the row in the On Row Save property of the Editable Table.

Of course, if you really must, you can implement a "single save" approach, but I would argue against it on usability grounds.

That said, I would advise you to debug your application to see what goes wrong. Note that for both the Editable Table and the Form you need to use the Record List / Record of the Widget, not the original record or list.


Hi,

If not editable table what would you suggest me to use for a matrix-like structure as below,


TypeBx1Bx2Bx3
By1111
By2000
By3  0

   

   





The fields can be updated.



Hi Neha,

Why can't you have 2 forms on single page?

I would recommend, on Form A, show Table A data nad on Formb, show Table B data. Have one common save button for this and while saving pass input records form respective forms.

Thanks and Regards,

Suraj Borade

Hi Suraj,

"B" is shown as tabular data, and has a List as input. You can't use Lists with a Form.

Kilian Hekhuis wrote:

Hi Suraj,

"B" is shown as tabular data, and has a List as input. You can't use Lists with a Form.

Sorry I misread the reply but in original question it is not mentioned and second question also say By1, Bx1.


I think we need more details here.

@Neha: can u plz elaborate?


Hi Neha,

Do you need to be able to add records as well? If not, you could use a Table Records with input fields.

Kilian Hekhuis wrote:

Hi Neha,

Do you need to be able to add records as well? If not, you could use a Table Records with input fields.

So the challenge is I have a matrix, so If there is 5x5 matrix then, in that case, I will have to create an entity and with 25 attributes in it.

Or let me know if any other approach can be followed


Hi Neha,

25 attributes? I wouldn't think so. If it's a matrix, you have rows and columns, and typically a row coincides with a database record. So if you have 5 columns, that's 5 attributes, and 5 rows with those attributes. There's a similar question in the forum active at the moment, see my answer here.


Suraj Borade wrote:

Kilian Hekhuis wrote:

Hi Suraj,

"B" is shown as tabular data, and has a List as input. You can't use Lists with a Form.

Sorry I misread the reply but in original question it is not mentioned and second question also say By1, Bx1.


I think we need more details here.

@Neha: can u plz elaborate?

Hi,


As mentioned earlier I need data which is in the following:


TypeBx1Bx2Bx3
By1111
By2000
By3  0

   

   





To view the above data I thought an editable table is a correct option. Else I will have to create an entity having 6 attributes.

Please let me know if there is any other approach