Open child form from table (fill in data) abd return to main form.
I have a main table (quotes) and child tables (quotelines).
up to now, I have used selected data entry fields on the main table form and then used a button script to copy that data into a child record. (has always worked great and I will continue to use).
However, I have another need whereby I want to create and open the child record first (from a button again) fill in some data and then return back to main form. Don't want to use data entry field method for this as there will be lots of fields and this will clutter up the main form (and complicate the display if options)
Should work as if I pressed the "create record" function at foot of child table ( won't be using this as will a table view instead which will not show this option and then return back to main form showing the child table below.

A quick Test script works to create the child table but then on closure only shows the the child table for all ie not returning back to the main table record showing the child table view .
I have fiddled about with various option ie setting a type of on close record in form
let xCurrRec := Id; (from Quotes)
let xQLnum := QLnum;
let i := (create QuoteLines);
openRecord(i);
i.(Quotes := xCurrRec);
i.(QLnum := xQLnum);
QLnum := max(QuoteLines.QLnum) + 2 (my sub line counter which allowesa me to adjust to sort lines)
trying to pass xCurrRec did not seem to work
any suggetions ?
7 replies
-
Try putting the openRecord() line at the end. You need to allow Ninox to do the copying before you open the record. It is kinda like opening the oven before the soufflé is finished.
-
Fred
That done't work i can open the child record okay but it after data entry that i want to come back to the main form ie as per this image

Done a test DB
Open Quotes and use test copy button
-
Ah ha
I can do it by this! on said close button!
let xCopy := fxQteRef;
let i := first(select Quotes where QteNum = xCopy);
closeAllRecords();
openRecord(i)Thank you ( as usual) for the expert guidance 😊
-
👍
Content aside
- Status Answered
- yesterdayLast active
- 7Replies
- 19Views
-
3
Following
