This post is about how to create info Part in AX and use it on list page.
For this example; I am using Projects List page and will add Revenue Info Part on it.
Right click on AOT\Parts\Info Parts and create New Info Part
Assign Query to this info part I have assigned ProjTable_NoFilter query
Add New Group under Layout
Name it ProjectRevenue and set few properties as shown
For this example; I am using Projects List page and will add Revenue Info Part on it.
Right click on AOT\Parts\Info Parts and create New Info Part
Assign Query to this info part I have assigned ProjTable_NoFilter query
Add New Group under Layout
Name it ProjectRevenue and set few properties as shown
Add new fields under ProjectRevenue group and name it RevenueAtSales and RevenueAtOrders
I assigned ForecastRevenueAtSalesSw data method to field RevenueAtSales, this data method is written on at \Data Dictionary\Tables\ProjTable\Methods\forecastRevenueAtSalesSw
display AmountCur forecastRevenueSw()
{
ProjForecastOnAcc projForecastOnAcc;
real total;
// Sum all the prices with quantity of 1.
select sum(SalesPrice) from projForecastOnAcc
where projForecastOnAcc.ProjId == this.ProjId
&& projForecastOnAcc.Qty == 1;
total = projForecastOnAcc.salesPrice;
// Support non-unity quantities.
while select SalesPrice, qty from projForecastOnAcc
where projForecastOnAcc.ProjId == this.ProjId
&& projForecastOnAcc.Qty != 1
{
total += (projForecastOnAcc.salesPrice * projForecastOnAcc.qty);
}
return total;
}
Add this Info part to ProjProjectsListPage as I want to see this on Project List page.
Right click on Parts node in ProjProjectsListPage
Name it FF_ProjectRevenue
Set IsLinked Property to YES, this property will link this part to the list page based on Datasource (ProjTable)
No comments:
Post a Comment