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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.07.2012, 00:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: How to import default site and warehouse locations for a product using services (AIF)
Источник: http://blogs.msdn.com/b/axsupport/ar...-services.aspx
==============

I have recently had questions around how to import default site and warehouse locations for products when using AIF, so I thought an explanation and an example here might be helpful.

Three tables need to have the correct Dimension ID relationships setup in order for the item to
default the correct Site/Warehouse combination.

Within AX, you can set these defaults by going to :
Setup-Default Order Settings (Site specific)
Setup-Site Specific Order Settings (Site and Warehouse)

If you manually set those values, it adds the following records in each of the
tables below:

InventItemSalesSetup
InventItemPurchaseSetup
InventItemInventSetup

By adding values to the Default Order Settings, it creates a record with the

InventDimID Field=AllBlank2
InventDimIDDefualt=’’ (Dimension for the Site=1)


By adding values to the Site Specific Order settings, it creates a second
record with the following values:

InventDimID Field=’’ (Dimension including the Warehouse)
InventDimIDDefualt=’'



For importing these records, you need to follow a similar pattern...

The first record would have the following fields represented (all other fields
would match current default values)

InventDimID Field=AllBlank2
InventDimIDDefault=’’ (Dimension for the Site=1)

The second record would have the following fields represented (all other fields
would match current default values)

InventDimID Field=’’ (Dimension for the Site=1)
InventDimIDDefault=’’ (Dimension including the Warehouse)

Here is a sample snippet (change the hard-coded values to match your data)…



arrpursetup = new AxdEntity_InventItemPurchSetup[2];
pursetup = new AxdEntity_InventItemPurchSetup() { ItemId = "CFL33" };
pursetup.InventDimPurchSetup = new AxdEntity_InventDimPurchSetup[]
{ new AxdEntity_InventDimPurchSetup()
{ InventDimId = "AllBlank2"}};

pursetup.DefaultInventDimPurchSetup = new AxdEntity_DefaultInventDimPurchSetup[]
{ new AxdEntity_DefaultInventDimPurchSetup()
{ InventSiteId = "1"} };

arrpursetup[0] = pursetup;

pursetup = new AxdEntity_InventItemPurchSetup() { ItemId = "CFL33" };
pursetup.InventDimPurchSetup = new AxdEntity_InventDimPurchSetup[]
{ new AxdEntity_InventDimPurchSetup()
{ InventSiteId = "1"}};

pursetup.DefaultInventDimPurchSetup = new AxdEntity_DefaultInventDimPurchSetup[]
{ new AxdEntity_DefaultInventDimPurchSetup()
{ InventLocationId = "11"} };

arrpursetup[1] = pursetup;

arrslssetup = new AxdEntity_InventItemSalesSetup[2];
slssetup = new AxdEntity_InventItemSalesSetup() { ItemId = "CFL33" };
slssetup.InventDimSalesSetup = new AxdEntity_InventDimSalesSetup[]
{ new AxdEntity_InventDimSalesSetup()
{ InventDimId = "AllBlank2"} };
slssetup.DefaultInventDimSalesSetup = new AxdEntity_DefaultInventDimSalesSetup[]
{ new AxdEntity_DefaultInventDimSalesSetup()
{ InventSiteId = "1"} };
arrslssetup[0] = slssetup;

slssetup = new AxdEntity_InventItemSalesSetup() { ItemId = "CFL33" };
slssetup.InventDimSalesSetup = new AxdEntity_InventDimSalesSetup[]
{ new AxdEntity_InventDimSalesSetup()
{ InventSiteId = "1"} };
slssetup.DefaultInventDimSalesSetup = new AxdEntity_DefaultInventDimSalesSetup[]
{ new AxdEntity_DefaultInventDimSalesSetup()
{ InventLocationId = "11"} };
arrslssetup[1] = slssetup;

arrinventsetup = new AxdEntity_InventItemInventSetup[2];
inventsetup = new AxdEntity_InventItemInventSetup() { ItemId = "CFL33" };
inventsetup.InventDimInventSetup = new AxdEntity_InventDimInventSetup[]
{ new AxdEntity_InventDimInventSetup()
{ InventDimId = "AllBlank2"} };
inventsetup.DefaultInventDimInventSetup = new AxdEntity_DefaultInventDimInventSetup[]
{ new AxdEntity_DefaultInventDimInventSetup()
{ InventSiteId = "1"} };
arrinventsetup[0] = inventsetup;

inventsetup = new AxdEntity_InventItemInventSetup() { ItemId = "CFL33" };
inventsetup.InventDimInventSetup = new AxdEntity_InventDimInventSetup[]
{ new AxdEntity_InventDimInventSetup()
{ InventSiteId = "1"} };
inventsetup.DefaultInventDimInventSetup = new AxdEntity_DefaultInventDimInventSetup[]
{ new AxdEntity_DefaultInventDimInventSetup()
{ InventLocationId = "11"} };
arrinventsetup[1] = inventsetup;




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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: Multisite activation within the upgrade process Blog bot DAX Blogs 0 25.05.2012 02:13
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
dynamics-ax: Product Management with Microsoft Dynamics AX 2012 - Part III Blog bot DAX Blogs 0 17.05.2011 17:11
dynamics-ax: Product Management with Microsoft Dynamics AX 2012 - Part II Blog bot DAX Blogs 0 11.05.2011 06:15
dynamicsaxtraining: Setup initial data (Vendor, Warehouse, Equipment) Blog bot DAX Blogs 0 07.12.2009 19:05
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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