When I add a new parent record, I want to populate the child with several records.
I used aftercreate, as follows:
Code:
// Event delegate for 'aftercreate' event
proc Parent_Child_section1_aftercreate()
// insert your code here
rem_sel = select()
rem_acc_cid = account.cid
select period
kkper = 0
scan
select accdet
append blank
replace accdet.fk_acc with rem_acc_cid
replace accdet.fk_per with period.cid
replace accdet.ddaat with period.daat
kkper = kkper + 1
endscan
select (rem_sel)
messagebox(ltrim(str(kkper)),64,'Periods added')
endproc
There are 6 records in the period file; the above does create the 6 records, but only the first 5 have all the information written to the table.
What should i do to ensure that the last record added is written properly?
Bookmarks