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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 01.11.2018, 16:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Create Contact Person for Vendor Or Customer AX 2012 & D365FO
Источник: http://d365technext.blogspot.com/201...vendor-or.html
==============



Create Contact Person for Vendor Or Customer AX 2012 & D365FO


Important

In D365FO use ContactPersonSyncEntity class and in AX 2012 use ContactPersonEntity



Using below code you can create contact person against Customer or Vendor in AX 2012 & D365FO.





classSLD_DemoInstance
{











publicstaticvoid main(Args _args)
{


// Declare variables: views.
DirPartyContactInfoView contactInfo;
DirPartyPostalAddressView postalAddress;


// Declare variables: tables.
ContactPerson contactperson;


DirPartyTable partyTable = DirPartyTable::findRec(VendTable::find("S00038").Party);

// Declare variables: classes.
ContactPersonEntity contactPersonEntity;






// Create and populate the contact person.


contactPersonEntity = ContactPersonEntity::construct(contactPerson);

contactPersonEntity.parmFirstName("FirstName");
contactPersonEntity.parmMiddleName('M.');
contactPersonEntity.parmLastName('Person');
contactPersonEntity.parmAssistantName('AssistantName');
contactPersonEntity.parmBillingInformation('Billing info');
contactPersonEntity.parmCharacter('Character description');
contactPersonEntity.parmComputerNetworkName('Computer network name');
contactPersonEntity.parmContactForParty(partyTable.RecId);
contactPersonEntity.parmContactMemo('Memo');
contactPersonEntity.parmContactPersonId('CP64');
contactPersonEntity.parmLoyalty('Loyalty');
contactPersonEntity.parmMileage('Mileage');
contactPersonEntity.parmOfficeLocation('Office location');
contactPersonEntity.parmOutlookCategories('Outlook categories');
contactPersonEntity.parmProfession('Profession');
contactPersonEntity.parmSensitivity(smmSensitivity::Personal);
contactPersonEntity.parmSpouse('Spouse');
contactPersonEntity.parmTimeAvailableFrom(1000);
contactPersonEntity.parmTimeAvailableTo(2000);
contactPersonEntity.write();


// Populate the postal address information by using the view.
postalAddress.clear();
postalAddress.Street = 'One Microsoft Way';
postalAddress.City = 'Redmond';
postalAddress.State = 'WA';
postalAddress.ZipCode = '98052';

postalAddress.Address="QAR";
postalAddress.CountryRegionId = "Country Region ID";




// Update the postal address information.
contactPersonEntity.createOrUpdatePostalAddress(postalAddress);




//phone


contactInfo.clear();
//Populate the contact information by using the view.
contactInfo.LocationName="Phone";
contactInfo.Locator = "123456";
contactInfo.Type = LogisticsElectronicAddressMethodType::Phone;
contactInfo.IsPrimary = true;
// Update the contact information.
contactPersonEntity.createOrUpdateContactInfo(contactInfo);









contactInfo.clear();
//Populate the contact information by using the view.
contactInfo.LocationName="Email";
contactInfo.Locator ="abcd@gmail.com";
contactInfo.Type = LogisticsElectronicAddressMethodType::Email;
contactInfo.IsPrimary = true;
// Update the contact information.
contactPersonEntity.createOrUpdateContactInfo(contactInfo);






contactInfo.clear();
//Populate the contact information by using the view.
contactInfo.LocationName="FAX";
contactInfo.Locator ="98798789798";
contactInfo.Type = LogisticsElectronicAddressMethodType::Fax;
contactInfo.IsPrimary = true;
// Update the contact information.
contactPersonEntity.createOrUpdateContactInfo(contactInfo);


}


}



Источник: http://d365technext.blogspot.com/201...vendor-or.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
stephenmann: Technical History of Dynamics AX - From Axapta 3.0 to AX2012 Blog bot DAX Blogs 5 03.03.2017 10:22
DAX: Microsoft Dynamics AX 2012 R3 is now available! Blog bot DAX Blogs 1 02.05.2014 23:00
amer-ax: It was a great day! Blog bot DAX Blogs 3 29.12.2012 01:02
DAX: Official Dynamics AX 2012 R2 Content (update) - Where is it, and how can you find out about updates? Blog bot DAX Blogs 0 03.12.2012 11:11
rumicrosofterp: Dynamics AX на Convergence 2012 Blog bot Microsoft и системы Microsoft Dynamics 0 13.01.2012 11:11
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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