Hii,
There is an AOT Query SalesHeading and it is being used by Sales and marketing > Reports > Transactions > Sales orders > Sales order report.
I am creating a view from SalesHeading query but no success to get values from its display methods.
I need it for Power BI for analysis.
In the view I am trying to create computed columns but no luck.
How to convert following display methods into Computed columns in a View?
server display AmountCur amountInvoiced()
{
CustInvoiceJour custInvoiceJour;
select sum(InvoiceAmount) from custInvoiceJour
where custInvoiceJour.RefNum == RefNum::SalesOrder
&& custInvoiceJour.SalesId == this.SalesId;
return custInvoiceJour.InvoiceAmount;
}
server display AmountCur amountOrderedNotInvoiced()
{
SalesLine salesLine;
AmountCur ordered;
while select salesLine
where salesLine.SalesId == this.SalesId
{
ordered += salesLine.calcLineAmountExclTax(salesLine.RemainSalesPhysical+salesLine.RemainSalesFinancial);
}
return ordered;
}
return (select firstonly InvoiceId
from custInvoiceSalesLink
index hint origSalesIdx
order by InvoiceDate desc, InvoiceId desc
where custInvoiceSalesLink.OrigSalesId == this.SalesId).InvoiceId;
There are many other complex display methods like
SalesTable.contributionMargin()
SalesTable.lastInvoice()
SalesTable.lastInvoiceDate()
SalesTable.lastPackingSlip()
SalesTable.lastPackingSlipDate()
totally stuck, what is a better approach to get data for BI application.
need help
Thanks,