Add record Button
I want to create a button to add new record in a table named 'Interventi' from a table 'Caldaie'.
The button on click must add a new record in a table 'Interventi' inheriting some field inserted in table 'Caldaie'.
How to do it?
Thank you.
Sorry for my bad english.
6 replies
-
Hi Alex,
Let's assume that you have 2 tables with common fields: DateField and TextField.
The code for the button in the table Caldaie:
---
let myID := Id;
let dt := Date;
let txt := Text;
let i := (create Interventi);
i.(Date := dt);
i.(Text := txt);
openRecord(i)---
-
Thanks, the routine works perfectly!
-
In the above situation, if both tables are the children of a Contacts table, how can I pass the Contacts.name from one child table to the other child table when the new record is created?
-
@Dean,
If I understand you correctly, this creates records to both child tables and sets the Contact Name:
---
let myID := Id;
let name1 := Contact_Name;
let c1 := (create Child_1);
c1.(Contact := myID);
c1.(Contact_Name := name1);
let c2 := (create Child_2);
c2.(Contact := myID);
c2.(Contact_Name := name1)---
-
@Nick,
Thank you very much for your clear reply and image!
-
You 're welcome gyus!
Content aside
- 5 yrs agoLast active
- 6Replies
- 2075Views