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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 09.06.2021, 22:12   #1  
Blog bot is offline
Blog bot
Участник
 
24,236 / 809 (75) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: Handy queries for addresses and contact information
Источник: https://dynamicsaxinsight.wordpress....t-information/
==============

Purpose:

The purpose of this blog post is to share handy queries for addresses and contact information with the community
  • Get site from contact information record
  • Get site from address record
  • Get warehouse from contact information record
  • Get warehouse from address record
  • Get customer from contact information record
  • Get customer from address record
  • Get vendor from contact information record
  • Get vendor from address record
Product:

D365 Finance and Operations + Dynamics AX 2012

Code:

static void Address_Contact_Info_Queries(Args _args){ InventLocationLogisticsLocation inventLocationLogisticsLocation; InventSiteLogisticsLocation inventSiteLogisticsLocation; LogisticsElectronicAddress logisticsElectronicAddress; LogisticsPostalAddress logisticsPostalAddress; LogisticsLocation logisticsLocation; InventLocation inventLocation; InventSite inventSite; DirPartyLocation dirPartyLocation; DirPartyTable dirPartyTable; CustTable custTable; VendTable vendTable; ; // Get site from communication details while select inventSite join inventSiteLogisticsLocation where inventSiteLogisticsLocation.Site == inventSite.RecId join firstonly logisticsLocation where logisticsLocation.ParentLocation == inventSiteLogisticsLocation.Location join firstOnly logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId && logisticsElectronicAddress.RecId == 5637634246 { info(strFmt("1. Site contact %1 %2", inventSite.SiteId, logisticsElectronicAddress.Locator)); } // Get site from addresses while select inventSite join inventSiteLogisticsLocation where inventSiteLogisticsLocation.Site == inventSite.RecId join firstonly logisticsLocation where logisticsLocation.RecId == inventSiteLogisticsLocation.Location join firstOnly logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId && logisticsPostalAddress.RecId == 5638869576 { info(strFmt("2. Site address %1 %2", inventSite.SiteId, logisticsPostalAddress.Address)); } // Get warehouse from communication details while select inventlocation join inventLocationLogisticsLocation where inventLocationLogisticsLocation.InventLocation == inventlocation.RecId join firstonly logisticsLocation where logisticsLocation.ParentLocation == inventLocationLogisticsLocation.Location join firstOnly logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId && logisticsElectronicAddress.RecId == 5639502490 { info(strFmt("3. Warehouse contact %1 %2", inventlocation.InventLocationId, logisticsElectronicAddress.Locator)); } // Get warehouse from addresses while select inventlocation join inventLocationLogisticsLocation where inventLocationLogisticsLocation.InventLocation == inventlocation.RecId join firstonly logisticsLocation where logisticsLocation.RecId == inventLocationLogisticsLocation.Location join firstOnly logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId && logisticsPostalAddress.RecId == 5638869577 { info(strFmt("4. Warehouse address %1 %2", inventlocation.InventLocationId, logisticsPostalAddress.Address)); } // Get customer from communication details while select custTable join dirPartyTable where dirPartyTable.RecId == custTable.Party join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId join firstOnly logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join firstOnly logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId && logisticsElectronicAddress.RecId == 5638681887 { info(strFmt("5. Customer contact %1 %2", custTable.AccountNum, logisticsElectronicAddress.Locator)); } // Get customer from addresses while select custTable join dirPartyTable where dirPartyTable.RecId == custTable.Party join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId join firstOnly logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join firstOnly logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId && logisticsPostalAddress.RecId == 5638869578 { info(strFmt("6. Customer address %1 %2", custTable.AccountNum, logisticsPostalAddress.Address)); } // Get vendor from communication details while select vendTable join dirPartyTable where dirPartyTable.RecId == vendTable.Party join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId join firstOnly logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join firstOnly logisticsElectronicAddress where logisticsElectronicAddress.Location == logisticsLocation.RecId && logisticsElectronicAddress.RecId == 5638265744 { info(strFmt("7. Vendor contact %1 %2", vendTable.AccountNum, logisticsElectronicAddress.Locator)); } // Get vendor from addresses while select vendTable join dirPartyTable where dirPartyTable.RecId == vendTable.Party join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId join firstOnly logisticsLocation where logisticsLocation.RecId == dirPartyLocation.Location join firstOnly logisticsPostalAddress where logisticsPostalAddress.Location == logisticsLocation.RecId && logisticsPostalAddress.RecId == 5638869579 { info(strFmt("8. Vendor address %1 %2", vendTable.AccountNum, logisticsPostalAddress.Address)); }}


Источник: https://dynamicsaxinsight.wordpress....t-information/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxinsight: Create contact information in X++ Blog bot DAX Blogs 0 20.10.2020 08:11
stoneridgesoftware: Locating Primary Contact Information for a Specific Warehouse using Dynamics AX Blog bot DAX Blogs 0 01.06.2016 22:11
Leon's CRM Musings: Battle of the Contact Information Sources: Jigsaw vs Dunn and Bradstreet vs LinkedIn Blog bot Dynamics CRM: Blogs 0 19.08.2012 17:12
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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