Insert Record - Table Parent + Child

ok, 2 forms but with only one button save

It should’t take 40 replies to simply explain you need two forms for your inserts …

That is more than clear. My question is - on your page, how do you say how many records you want to insert in the details table? I.e. how many inputs should be there to fill with info?

1 Like

the insertion of details is variable. it can be 1 as 10. Do you have an invoice? so I need a table or a grid for entering details

How do you set the variable value 1 or 10? Where it comes from?

NO, INCREASE IN TIME WHEN I ADD A LINE IN THE TABLE

What table do you mention again?

I ask you - how do you set how many input fields to be here:

OK, DETAIL INPUT no textinput but table

Sorry, it is really hard to understand what do you mean.

similar to this

It’s up to you how to build your layout.
My question remains unanswered:

what do you mean by variable?

I cannot answer this, it is what you said already:

I have a problem
I created Server Connect Action and it result in json format: {“query_last_doc_number”:[{“MAX(numero)”:11}]}
it’s work

Resul in json:
step2

In php page I want to populate a textinput but I can’t do it:

The resul is blank textinput:
step4
Why ?

use an alias for the column

ok, it works
thank you

@Teodor I suppose that he means that in the invoice he need to add from one to 10 lines, depending the invoice.

I suppose he should use a variable that increase each time he click on the button to add a new line to invoice with maximum 10 lines.

Hi, How can I do what you did in this picture?

Please, replay me. Thank you

What I am assuming is that you want to create an invoice/packing-list for items that are being ordered.

This process can be made very involved and I would have at least 4 tables to do this.

  • customers
  • stock items
  • invoice
  • ordered items for the invoice.

Assuming that you are not worried about the server actions for the first two list items, the page for the invoice would be similar to
image

Underneath that, you would have the items that have been purchased like
image

To add an item, have an ‘Add’ button. When the button is clicked, it shows a modal containing a form including the form fields required to identify the purchased item. When the modal form has been saved, it will close the modal and refresh the data source to reveal the just purchased item in the ‘detttagli del documento’ part of the page.

Using this method, you can add as many items as required.

A similar method can be used when creating a new invoice. Have a button on the page to add a new invoice, a modal form will appear and the new details of the invoice can be entered.

I hope this helps.

exact what you assume, but I do not know how to do it
Can you help me ?