Hello Giorgio,
the if test works and now copy the header of invoice correctly.
The steps are following and I got now problem on refreshing the invoice pages.
- Find the invoice to copy . OK for istance Nr. 4 the last inserted.
- Click on button Copy and now it copy all header infos from invoice 4 and within the invoice nr. field it propose correctly nr. 5
- I change for istance the invoice date and eventually other info and then, once ready, I click on Insert/add button
- Now my willing is to have the header invoice record saved and the form proposing again invoice nr. 5 just created.
At the moment SC come back to show me, after insert button clicking, the invoice where I started the copy and in this case invoice nr. 4.
and in pages the refreshing is not done. In brief to see the new invoice inserted I need to change page on the bottom using Arrow buttons and then go to first record again . In that moment I can see the new nr. 5 invoce header correctly.
I’ve tried to add a sc_commit_trans(); within event onAfterInsert but still SC re-propose the nr 4.
I can’t insert sc_redir(invoice_form) to reload the form using the ORDER BY invoice number DESC sorting
becouse it need makes some checks and another application . (I ask to user if he likes to update “PrimaNota” table)
I don’t know … what to do, now I’m stucked here…