Accessing the immediate previous record
I am trying to make a finance application using deluge script. I want to access the data from the immediate previous record while submitting a form.(For calculating the "balance" variable.).
say,
"Entry" is a pick list, "Credit_In" and "Debit" are its values, "balance" is the account balance.
If(Entry=="Credit_In")
{
balance=Cr_Amount + <balance.immediate previous record> ;
}
else If(Entry=="Debit")
{
balance=<balance.immediate previous record> - Dr_Amount ;
}
Here what should I enter instead of <balance.immediate previous record> ?
I searched the entire deluge help document. I could find only
<collectionvariable> = <formname>[criteria]; command.
What is the deluge variable for the immediate previous record?
Please help me...