FileMaker 16 normal invoice-systems with lineitems.
On the Invoice layout I have an unstored calc to sum the amount of the invoice.
It is a sum of an unstored calc on the lineitems table ( qty x price x disc. etc)
On the list layout of this Invoice I have a stored number field, which should match the unstored calc. – I think it is considered good practice for speed.
I use an onrecordcommit scriptstep to keep these numbers in sync. And it seems to work when something on the invoice is changed.
However one of my scripts on the invoice layout deletes a portal row, and when this script runs the system fails.
In the script I have a delete Portal row with a commit afterwards. This triggers the ”sync script” to run, but when it sets the stored number field to the total it is the total before the row was deleted.
Can this be solved ?
Is there a better way to handle this ?