AnsweredAssumed Answered

Script trigger problem: endless loop when triggered

Question asked by DavidGunter on Aug 15, 2016
Latest reply on Aug 16, 2016 by DavidGunter

This is a problem I'm having with script triggers. I have created this script for updating a bank register. The fields are check, deposit and balance.

$bal is set to the opening balance. The script is called to recalculate the current balance on the same record after a check or deposit is manually entered, just like a bank register.

Go to layout ["bankregister"]
Got record/Request/Page/First
Set variable[$bal;Value:bankregister::balance]
Go to record/Request/Page[Next;Exit after last]
Insert Calculated Result [Select;bankregister::balance; $bal-          bankregister::check+bankregister::deposit]

Works great when the script is manually selected to run, but when I use any sort of a trigger
it runs into the endless loop, making it useless. The trigger would ideally be when a deposit or check is entered manually, then commited with the return key. Another trigger could be a radio button with 'account type' ('current' or 'checking' are the values here)

Any ideas? Thanks in advance