Hi guys!
I’m running 15.0.00.
I made my first module using the builder. Validating an invoice triggers a script which creates an invoice object to my accounting agency’s system so I don’t have to create all the invoice lines manually.
The problem is that when I validate my invoice the FIRST TIME, the invoice REF passed to my script is still (PROVxxxx). It should be like 123456. I can fix it by modifying and re-validating, and then it works.
So I guess the trigger runs before the invoice gets validated, and the “old” ref is passed to the runTrigger in $object->ref.
Is there any way to get the invoice number, which is about to be given to the invoice? The system knows it already at that point, because is is visible in the “Do you want to validate…” -dialog.
Thanks in advance for your help!