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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.07.2009, 03:07   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
DynamicsAxSCM: Picking update via .Net Business Connector
Источник: http://blogs.msdn.com/dynamicsaxscm/...connector.aspx
==============

We have received extensive feedback on previous blog postings about the outbound processes within Inventory management in Microsoft Dynamics AX. Many readers have requested information on how to interact with Microsoft Dynamics AX via .NET Business Connector to create picking operations.

With this technical posting we will try to demonstrate how easy it is to code a terminal solution in C# .NET and call simple picking update methods in Microsoft Dynamics AX.

The solution is coded by using Microsoft.Dynamics.BusinessConnectorNet;

You will need a reference in the project to run the example code.

HINT: Get more information about the .NET Business Connector at MSDN (Microsoft Dynamics AX Developer Center) http://msdn.microsoft.com/en-us/library/aa659581.aspx

This small Microsoft Visual Studio project includes information about:

How to log on to an AX installation

// company name, language, object server, configuration // this uses Windows Authentication ax.Logon(CompanyId, null, null, null);.csharpcode { FONT-SIZE: small; COLOR: black; FONT-FAMILY: consolas, "Courier New", courier, monospace; BACKGROUND-COLOR: #ffffff}.csharpcode PRE { FONT-SIZE: small; COLOR: black; FONT-FAMILY: consolas, "Courier New", courier, monospace; BACKGROUND-COLOR: #ffffff}.csharpcode PRE { MARGIN: 0em}.csharpcode .rem { COLOR: #008000}.csharpcode .kwrd { COLOR: #0000ff}.csharpcode .str { COLOR: #006080}.csharpcode .op { COLOR: #0000c0}.csharpcode .preproc { COLOR: #cc6633}.csharpcode .asp { BACKGROUND-COLOR: #ffff00}.csharpcode .html { COLOR: #800000}.csharpcode .attr { COLOR: #ff0000}.csharpcode .alt { MARGIN: 0em; WIDTH: 100%; BACKGROUND-COLOR: #f4f4f4}.csharpcode .lnum { COLOR: #606060}How to read data from AX and insert the data in a grid on a Windows form



View picking routes in the upper pane and picking lines in the lower pane.

How to prepare data and call picking update functions from the .NET C# code

Picking in AX: In AX you can pick multiple lines by calling the WMSOrderTrans::finishPickingLinesMulti method. This method takes a packed AX Map where the key is the recId of the wmsOrdertrans to be picked and the value is an AX container with the OrderId and recVersion.

The example shows how to prepare the map and call the method to do the pick.

private AxaptaObject BuildAxaptaMapForWMSPickingLines(){//build a map of the following structure//key is WMSOrderTrans.recId and whose value //is [WMSOrderTrans.OrderId,WMSOrderTrans.recVersion].AxaptaObject axMap = ax.CreateAxaptaObject("Map", (int)Types.Int64,(int)Types.Container);foreach (DataGridViewRow dgvRow in wmsOrderTransGrid.SelectedRows){ AxaptaContainer axContainerWMSPair = ax.CreateAxaptaContainer(); DataRow row = null; DataRowView drv = (DataRowView)dgvRow.DataBoundItem; row = drv.Row; axContainerWMSPair.Add(row.Field<SPAN class=kwrdstring/SPAN>(1)); //orderid axContainerWMSPair.Add(row.Field(7)); //recversion //add to axapta map axMap.Call("Insert", row.Field(6), axContainerWMSPair);} return axMap;} private void PickSelectedLinesFromMap(AxaptaObject axaptaObjectMap){ // call below takes a packed map whose key is // WMSOrderTrans.recId and whose value is // WMSOrderTrans.OrderId,WMSOrderTrans.recVersion. ax.CallStaticClassMethod("WMSOrderTransType", "finishPickingLinesMulti", axaptaObjectMap.Call("pack"));}
Apart from the method to multi-update picking lines the project also includes a method to pick-update multiple picking routes by calling WMSPickingRoute::finishMulti.

private void PickSelectedRoutesFromList(AxaptaObject axList)
{
ax.CallStaticRecordMethod("WMSPickingRoute",
"finishMulti",
axList.Call("pack"));
}


Have fun trying this yourself!

Bibi Christensen, Alexander Malafeev, Per Lykke Lynnerup & Lennart Conrad



Источник: http://blogs.msdn.com/dynamicsaxscm/...connector.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
DynamicsAxSCM: Changes in Sales and Transfer Order Picking from Microsoft Dynamics AX 4.0 to Dynamics AX 2009 Blog bot DAX Blogs 0 18.05.2009 02:05
Arijit Basu: DAX 4.01 .NET Business Connector: Microsoft.Dynamics.BusinessConnectorNet Blog bot DAX Blogs 3 30.09.2008 01:17
Inside Dynamics AX 4.0: Working with the .NET Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
Inside Dynamics AX 4.0: Inside the Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
ALEG: Проект "Фишка недели" и первый пост - Microsoft Dynamics™ AX .NET Business Connector Blog bot DAX Blogs 1 22.11.2006 09:43
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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