* Get total for Invoice in Progress lnTotal = GetInvoiceTotal() * Get total for specific Invoice lnTotal = GetInvoiceTotal(46546546) ... PROCEDURE GetInvoiceTotal(InvoiceID) IF PCOUNT() = 1 This.GetInvoiceLines(InvoiceID) ENDIF This.SelectAlias("Invoice") SUM Amount TO Total RETURN Total>I have a function like the following, used to get the total for a single invoice.
>PROCEDURE GetInvoiceTotal() >This.SelectAlias("Invoice") >SUM Amount TO Total >RETURN Total >>
>PROCEDURE GetInvoiceTotal(InvoiceID) >This.GetInvoiceLines(InvoiceID) >This.SelectAlias("Invoice") >SUM Amount TO Total >RETURN Total >>the problem is that GetInvoiceLines() by definition reloads the Invoice cursor, destroying any pending changes. This means I can't use it within the context of a single invoice anymore.