PROCEDURE GetInvoiceTotal() This.SelectAlias("Invoice") SUM Amount TO Total RETURN TotalNow, I want to call GetInvoiceTotal() from a global object, and specify the invoice it should total. If I change the function to the one below,
PROCEDURE GetInvoiceTotal(InvoiceID) This.GetInvoiceLines(InvoiceID) This.SelectAlias("Invoice") SUM Amount TO Total RETURN Totalthe 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.