This topic is locked
[SOLVED]

copy with record with master detail relation ship

8/7/2021 1:45:48 AM
PHPRunner General questions
M
markryan author

how to copy ex sales invoice, to a new record which includes it details. it just copy the master table. Thanks

A
AlphaBase 8/7/2021

I don't know that PHPR gives you a way to do that? So I think you're going to have to code it:

Insert Parent A as new parent B
Get Parent B last identity
Insert Child A into Child B using the last identity as the FK

If you don't know how to do that not sure how you would proceed, except manually.

M
markryan author 8/8/2021

insert you mean insert it in the database? in phprunner, copy is not yet inserted, it just display via form before inserting it to the database.

HJB 8/8/2021

I could locally reproduce what you mean, say, the COPY RECORD functionality only works on the fields ABOVE
the items list. If you wish to own a repititive invoicing (e.g. customer gets a weekly or monthly bill of continously
invoiced services), the only chance is to replace the "... on the fly ..." items fields by ordinary 5 or so new entry
fields (assuming 5 items to be the usual maximum of your billing needs). In other words, if 5 permanent items
rows appear as target fields, the COPY RECORD action should work.