In the case of an invoicing solftware, where we have the invoice and its items. Is there a way to duplicate an invoice and automatically duplicate its records?
Sometimes, we just need to duplicate the whole invoice with its items included, maybe because the next invoice contains almost every item of the previous one or maybe the same items, and the only thing that chages is the customer.
I would appreciate any suggestions.
Duplicating records with children records together
- Celson Aquino
- Posts: 27
- Joined: 2017-08-26 15:40
- Location: Salvador, Bahia - Brazil
Re: Duplicating records with children records together
I think you'll need to use custom code in order to do that. I would take a look at documentation at https://bigprof.com/appgini/help/advanc ... ific-hooks and read the following hooks:
- tablename_after_insert()
- tablename_after_update()
You can add code inside these hooks that will read all records of the children table and, for each record, copy it to the new master table (new invoice).
- tablename_after_insert()
- tablename_after_update()
You can add code inside these hooks that will read all records of the children table and, for each record, copy it to the new master table (new invoice).
Re: Duplicating records with children records together
You just want to duplicate an Invoice? Simple solution with no coding?
Is the "Hide 'Save as Copy' when editing records" option unchecked for the invoicing table in Appgini?
If unchecked - you should have a "Save as Copy" button available when editing records. It will duplicate any record. Then just change your customer details?
Is the "Hide 'Save as Copy' when editing records" option unchecked for the invoicing table in Appgini?
If unchecked - you should have a "Save as Copy" button available when editing records. It will duplicate any record. Then just change your customer details?
- Celson Aquino
- Posts: 27
- Joined: 2017-08-26 15:40
- Location: Salvador, Bahia - Brazil
Re: Duplicating records with children records together
Yes, the "Save as Copy" will copy the record but will not copy the children record (on any children table). At least in my test right now, with a generated application (AppGini 5.62) it is just duplicating the record on current table and not on childrens.
Re: Duplicating records with children records together
Thank you Celson and Peebee,
It would be wonderful if appgini developer could implement this feature.
Of course I had tried before the "Save as Copy" feature, but as Celson says, it won´t copy the children records. Is there a way I can trigger my custom script on a hook when I click over the save as copy button?
It would be wonderful if appgini developer could implement this feature.
Of course I had tried before the "Save as Copy" feature, but as Celson says, it won´t copy the children records. Is there a way I can trigger my custom script on a hook when I click over the save as copy button?