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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 06.10.2010, 13:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,626 / 848 (80) +++++++
Регистрация: 28.10.2006
axhelper: Jump between InterCompany order lines
Источник: http://feedproxy.google.com/~r/AxHel...der-lines.html
==============

This is a basic job that describes how you can jump from one order line to another in the intercompany order structure.

In this example I have created an intercompany order that also has a linked purchase order in the production company to a vendor. This is one way you can use to jump up between the linked order lines.

I start out in the sales company “FO1” and go all the way up to the intercompany sales line in the production company “FO”, then I change company to “FO” so that I can gain access to the production company’s purchase line. From this purchase line I change the direction and move all the way back to the original sales line that is located in the sales company FO1.

As you can see I run the code while being in the sales company “FO1″. I start out with a specific sales line that I get by searching for its RecId. This code it meant to be run with a sales line as its basis. Preferably from the SalesTable form, the SalesLine table or some other object where you have sales line data that you want to explore.

X++:
static void FO_InterCompanyRefs(Args _args)
{
SalesLine salesLine =
SalesLine::findRecId(5637552101),
icSalesLine = null;
PurchLine purchLine,
icPurchLine;
;

// Sales company = FO1
// Production company = FO

// Original Sales Company SalesLine
print salesLine.SalesId;
print salesLine.ItemId;
print salesLine.dataAreaId;
print "------------------";

purchLine =
PurchLine::findInventTransId(
salesLine.InventRefTransId);

// Sales Company PurchLine
print purchLine.PurchId;
print purchLine.ItemId;
print purchLine.dataAreaId;
print "------------------";

icSalesLine =
purchLine.interCompanySalesLine();

// Production company SalesLine
print icSalesLine.SalesId;
print icSalesLine.ItemId;
print icSalesLine.dataAreaId;
print "------------------";

changecompany(icSalesLine.dataAreaId)
{

purchLine = PurchLine::findInventTransId(
icSalesLine.InventRefTransId);

// Production company PurchLine
print purchLine.PurchId;
print purchLine.ItemId;
print purchLine.dataAreaId;
print "------------------";

icSalesLine =
SalesLine::findInventTransId(
purchLine.InventRefTransId);

// Production company SalesLine
print icSalesLine.SalesId;
print icSalesLine.ItemId;
print icSalesLine.dataAreaId;
print "------------------";

purchLine =
icSalesLine.interCompanyPurchLine();

// Sales Company PurchLine
print purchLine.PurchId;
print purchLine.ItemId;
print purchLine.dataAreaId;
print "------------------";

salesLine =
purchLine.interCompanySalesLineOriginal();

// Sales Company PurchLine
print salesLine.SalesId;
print salesLine.ItemId;
print salesLine.dataAreaId;
print "------------------";
}

pause;

}
Источник: http://feedproxy.google.com/~r/AxHel...der-lines.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
sumitax: Intercompany – automatic purchase order creation Blog bot DAX Blogs 0 28.09.2010 16:05
palleagermark: It is possible for users to edit the Item reference fields of sales order lines and purchase order lines. Blog bot DAX Blogs 0 17.02.2010 21:07
palleagermark: Annoying bug in AX 2009 Intercompany Sales Order Blog bot DAX Blogs 0 21.01.2010 11:05
dynamicsaxtraining: Create purchase order Blog bot DAX Blogs 0 14.12.2009 14:05
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

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

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

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