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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.06.2016, 22:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
stoneridgesoftware: Locating Primary Contact Information for a Specific Warehouse using Dynamics AX
Источник: https://stoneridgesoftware.com/locat...fic-warehouse/
==============

This week I am going to talk about how to find the primary contact person and their phone number for a specific warehouse. This information in Dynamics AX is defined in Warehouse management >> Setup >> Warehouse setup >> Warehouses. You locate the warehouse in question and go to the Address fast tab. I had to click the Edit button as the demo data does not have this defined for the address I was wanting. On the New address form, you can enter in the contact information in the Contact information fast tab.

[IMG]file:///C:/Users/maddie/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg[/IMG]

Once this is done, the following job will find the contact information for the warehouse tied to a specific shipment.



static void testContactLogic(Args _args){ WHSShipmentTable shipmentTable = WHSShipmentTable::find('USMF-000002'); InventLocation inventLocation; LogisticsEntityPostalAddressView postalAddressView; LogisticsElectronicAddress electronicAddress; LogisticsLocation contactLocation; inventLocation = inventLocation::find(ShipmentTable.InventLocationId); if (inventLocation) { select firstonly postalAddressView where postalAddressView.Entity == inventLocation.RecId && postalAddressView.EntityType == LogisticsLocationEntityType::Warehouse && postalAddressView.isPrimary == NoYes::Yes; if (postalAddressView) { select firstOnly electronicAddress where electronicAddress.Type == LogisticsElectronicAddressMethodType::Phone join contactLocation where contactLocation.ParentLocation == postalAddressView.Location && contactLocation.RecId == electronicAddress.Location; info(strFmt("Primary contact name: %1 Primary contact phone: %2",electronicAddress.Description, electronicAddress.Locator)); } }}Please note this code could be optimized with more joins. I intentionally created the job above in this manner to more clearly demonstrate the relations needed, AND make it easier to step through via the debugger if so desired.

Oh, of course, I should show the output of this job as well:

[IMG]file:///C:/Users/maddie/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg[/IMG]

The above code could easily the modified for email, all contacts, etc.  This just demonstrates retrieving specific desired information for a specific warehouse based on shipment information.

Happy coding.



Источник: https://stoneridgesoftware.com/locat...fic-warehouse/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: AX Performance - What information and data to collect when you want to open a support case Blog bot DAX Blogs 0 29.09.2015 15:11
amer-ax: It was a great day! Blog bot DAX Blogs 3 29.12.2012 01:02
dynamics-ax: Interview with Microsoft's Lachlan Cash on his new role, AX 2012 and more Blog bot DAX Blogs 6 22.04.2011 14:55
dynamics-ax: Official Details about Dynamics AX '6' released, including comments from Microsofts Kees Hertogh Blog bot DAX Blogs 0 11.01.2011 05:22
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:30.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.