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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.07.2024, 18:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,584 / 848 (80) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: D365: Get worker email address by purpose in X++
Источник: https://dynamicsaxinsight.com/2024/0...urpose-in-xpp/
==============

Purpose:

Demonstrate how can get the worker email address by purpose.

Application:

Dynamics 365 for Finance and Operations

Business requirement:

Business requirement is to display worker email address with purpose “Purchase order” in a report.

Solution:

We can use the method below to get the worker email address by purpose which is defined in the extension class of HcmWorker table.

Code

[ExtensionOf(tableStr(HcmWorker))]internal final class ATLAS_HcmWorker_Table_Extension{ /// /// Get email address by purpose Feb 16, 24 MK. /// /// /// Atlas Dynamics Pty Ltd. /// public Email emailByPurpose(LogisticsLocationRoleName _name) { LogisticsElectronicAddressRole logisticsElectronicAddressRole; LogisticsElectronicAddress logisticsElectronicAddress; LogisticsLocationRole logisticsLocationRole; LogisticsLocation logisticsLocation; DirPartyLocation dirPartyLocation; DirPartyTable dirPartyTable; DirPerson dirPerson; select firstOnly logisticsElectronicAddress where logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email join logisticsElectronicAddressRole where logisticsElectronicAddressRole.ElectronicAddress == logisticsElectronicAddress.RecId join logisticsLocationRole where logisticsLocationRole.RecId == logisticsElectronicAddressRole.LocationRole && logisticsLocationRole.Name == _name join logisticsLocation where logisticsLocation.RecId == logisticsElectronicAddress.Location join dirPartyLocation where dirPartyLocation.Location == logisticsLocation.RecId join dirPartyTable where dirPartyTable.RecId == dirPartyLocation.Party join dirPerson where dirPerson.RecId == dirPartyTable.RecId && dirPerson.RecId == this.Person; return logisticsElectronicAddress.Locator; }}
We can then call this method in the following way to initialize temp table buffer.

purchOrderLineTmp.DimOwnerEmail = (hcmWorker.emailByPurpose(#PurchaseOrder)) ? (hcmWorker.emailByPurpose(#PurchaseOrder)) : hcmWorker.email();


Источник: https://dynamicsaxinsight.com/2024/0...urpose-in-xpp/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Sumit Potbhare: Retail Warehousing | Wrap up | Approach to D365 for Commerce with Adv WH Mgmt Blog bot DAX Blogs 0 28.04.2021 13:12
patrickmouwen: How to Unlock Many Hidden D365 Retail Features! Blog bot DAX Blogs 0 13.05.2020 22:13
patrickmouwen: D365 Retail APIs Part III: How to use the Retail APIs from Power Automate (Flow) and Logic App Blog bot DAX Blogs 0 28.01.2020 02:15
dynamicsaxinsight: D365: Send email in X++ using email templates Blog bot DAX Blogs 0 30.01.2019 14:11

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

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

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