Yes, but it would require a complex script and drive your users nuts by making the data entry process slow and jerky. Put a button on your invoice layout that uses a script to print the invoice that does a commit records (save) before printing. This will achieve the same results in far simpler fashion.
Hi Phil, Thanks for the answer. Do you have any example code for the "commit records (save)" .
I gave you the exact name of the script step:
Your script might be no more complex than:
Commit Records 
Or you may need to do more things before printing in order to get the correct results. I can't tell from here.