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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.10.2020, 08:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: Create contact information in X++
Источник: https://dynamicsaxinsight.wordpress....mation-in-xpp/
==============

Purpose:

The purpose of this blog post is to demonstrate how to create contact information in X++

Product:

Dynamics AX 2012

Description:

The code create contact information with purpose “Collection” on the customer record.

Code:

static void MAKCustContactCreate(Args _args) { #define.LocationRoleName('Collection') CustTable custTable; DirPartyTable dirPartyTable; LogisticsElectronicAddress logisticsElectronicAddress; LogisticsLocationRole locationRole; Map locationRoleMap; container locationRoleCon; ; custTable = CustTable::find('C000115'); dirPartyTable = DirPartyTable::findRec(custTable.Party); if (!dirPartyTable.existElectronicAddrbyRole(#LocationRoleName)) { locationRoleMap = new Map(Types::Int64, Types::String); locationRole = LogisticsLocationRole::findByName(#LocationRoleName); if (locationRole) { locationRoleMap.insert(locationRole.RecId, locationRole.description()); locationRoleCon = map2Con(locationRoleMap); ttsBegin; logisticsElectronicAddress.Type = LogisticsElectronicAddressMethodType::Email; logisticsElectronicAddress.Locator = 'testUserAccount2@domain.com'; logisticsElectronicAddress.Location = DirPartyLocation::findOrCreate(CustTable.Party, 0).Location; logisticsElectronicAddress = LogisticsElectronicAddress::findOrCreate(logisticsElectronicAddress); logisticsElectronicAddress = LogisticsElectronicAddress::findRecId(logisticsElectronicAddress.RecId, true); logisticsElectronicAddress.Description = "Email from X++"; logisticsElectronicAddress.IsPrimary = NoYes::No; logisticsElectronicAddress.update(); LogisticsEntityLocationRoleMap::createEntityLocationRoles(tableNum(LogisticsElectronicAddressRole), logisticsElectronicAddress.RecId, conPeek(locationRoleCon, 1), true); ttsCommit; info(strFmt("Created/updated email address %1 for customer %2.", logisticsElectronicAddress.Locator, custTable.AccountNum)); } } }


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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
d365technext: Create Contact Person for Vendor Or Customer AX 2012 & D365FO Blog bot DAX Blogs 0 01.11.2018 16:12
saurav-nav: NAV 2018 - Lots of New Objects! Blog bot NAV: Blogs 0 04.12.2017 10:11
atinkerersnotebook: Walkthrough & Tutorial Summary Blog bot DAX Blogs 1 09.09.2013 09:11
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, время: 13:22.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.