I have the requirement to add the Order Total to the SalesTable form in the grid. I was able to add the field using a display method. see code below: However the client has a further requirement that they must be able to filter on this new field. It is not possible to filter on a display message so I have proposed to create a new form with a view that contains the totals and then they can navigate to the SalesTable from there.
But now I am struggling to create a view with a column displaying the OrderTotal. Is it possible to do this with a computed column. Is there a different/better way to do this. The problem is all the examples of computed columns refer only to values in the current view, what do you do if you want to sum() of column in a different table.
[SysClientCacheDataMethodAttribute(true)]
public static display AmountCur PBFOrderTotal(SalesTable _salestable)
{
AmountCur totalOrder,
invoiceAmount;
SalesTotals salesTotals;
CustInvoiceTrans custInvoiceTrans;
salesTotals = SalesTotals::construct(_salestable);
totalOrder = salesTotals.totalAmount();
select sum(LINEAMOUNTMST) from custInvoiceTrans
where custInvoiceTrans.SalesId == _salestable.SalesId;
totalOrder = totalOrder + custInvoiceTrans.LINEAMOUNTMST;
return totalOrder;
}