Creating Parent Child Records

时间:2019-04-17 01:44:22

标签: google-app-maker

Can someone give me a bit of advice on the following (common) scenario.

I have a list of "Incident" records with an edit button for each The Edit button opens up an "Incident" edit form for that record The edit form contains a tab control with four tabs, each of which has a table for child (related) records: actions, documents, quotes and invoices

Take the first relation "actions". The table datasource is Incident: Action (relation). A Add Action button opens a page with a form with datasource inherited action and type insert

I remove the Incident Id dropdown because I want this to be populated automatically from the parent record.

I add a text box and give it a value: @pages.Edit_Incident.datasource.item.Id The text box is populated with the correct value

The submit button with OnClick Create New Item writes the record but does not persist the parent id or Incident_fk

What am I missing? This must be a common scenario. If I enforce referential integrity in the model it doesn't save. How can I persist the parent Id value to the Incident_fk field? I need to bind the text box to the datasource even though the page's datasource is correct

0 个答案:

没有答案