AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 18.02.2007, 15:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
Solutions Monkey: Enterprise Portal Demo script – 2
Источник: http://blogs.msdn.com/solutions/arch...-script-2.aspx
==============
Here is the second demo ( Thanks to Kenneth Puggaard).
Kevin, the Sales Manager wants to see the number of sales orders, open orders and back orders for each customer along with other customer information. In the first demo , we displayed the customer information directly from CustTable. In this demo , we are going to use AX data programmability to get count of sales orders for each customer and display it in the same web page.
Open AOT and navigate to the datasource of the webform that you want to add these aggregate information. Expand the Datasource node of the web form and select CustTable. Right click on the Methods sub node and select new method. Copy the text from below ( one method at a time) and create the below three display methods on the data source. Once it is done, then the same way as you did drag-n-drop of fields from CustTable to the WebGrid, you can drag-n-drop the display methods on to the webgrid to add these columns.
Go to Enterprise Portal and Refresh AOD to clear the cache. Now when you navigate to the web page that contains the webform, you will see these additional columns in the grid seamlessly rendering the values alongside information from the customer table.

display NumberOfRecords BackOrders()
{
SalesTable salesTable;
;
select count(recId) from salesTable
where salesTable.InvoiceAccount == custTable.AccountNum &&
salesTable.SalesStatus == SalesStatus::Backorder &&
salesTable.DeliveryDate < today()-1;

return salesTable.RecId;
}

display NumberOfRecords NoSalesOrders()
{
SalesTable salesTable;
;
select count(recId) from salesTable
where salesTable.InvoiceAccount == custTable.AccountNum &&
salesTable.SalesStatus == SalesStatus::Backorder ||
salesTable.SalesStatus == SalesStatus::Delivered ||
salesTable.SalesStatus == SalesStatus::Invoiced;

return salesTable.RecId;
}

display NumberOfRecords openSalesOrders()
{
SalesTable salesTable;
;
select count(recId) from salesTable
where salesTable.InvoiceAccount == custTable.AccountNum &&
salesTable.SalesStatus == SalesStatus::Backorder ||
salesTable.SalesStatus == SalesStatus::Delivered;

return salesTable.RecId;
}



==============
Источник: http://blogs.msdn.com/solutions/arch...-script-2.aspx
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Solutions Monkey: Microsoft Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks – 3 Blog bot DAX Blogs 0 27.10.2008 08:05
Solutions Monkey: Microsofty Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks - 2 Blog bot DAX Blogs 0 30.09.2008 07:07
Solutions Monkey: Enterprise Portal Screencasts at Channel9.msdn.com Blog bot DAX Blogs 6 01.07.2008 19:38
Solutions Monkey: Microsofty Dynamics AX 2009 Enterprise Portal / Role Centers - Deployment Tips-n-Tricks - 1 Blog bot DAX Blogs 0 26.06.2008 09:05
Solutions Monkey: Convergence 2008 - Microsoft Dynamics AX Enterprise Portal and Role Centers Blog bot DAX Blogs 0 09.03.2008 17:07

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 15:17.