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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.11.2018, 09:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Pass field value from SalesTable to CustTrans in AX 2012 & D365FO
Источник: http://d365technext.blogspot.com/201...stable-to.html
==============




Pass field value from SalesTable to CustTrans in AX 2012 & D365FO




AX 2012


Following are the steps to pass the value from Sales Table to custtrans.


1) Create a new field (If not already existing)


2) Create the parm method for that field on CustVoucher class


3) Assign value to this parm method in SalesInvoiceJournalPost.postCustVend() method by using the salesTable buffer


4) Add the code for assigning the variable value(or the parm method value) in CustVoucher.initCustVendTrans() method


And now post an invoice and go to custTrans table to check the field value.


Source AX-2012


D365FO


Add the field in SalesTable
Add the field in CustTrans
Create Extension class of SalesInvoiceJournalPost
Override postCustVend method using coc


[ExtensionOf(classStr(SalesInvoiceJournalPost))]
finalclassSLD_SalesInvoiceJournalPost_Extension
{
///
/// Performs the customer related postings.
///
protectedvoid postCustVend()
{
CustTrans custTrans;
Name ecomMethodOfPayment = this.salesTable.SLDTenderTypeName; // getting E-Com method of payment from Sales order


next postCustVend();


// getting the customer transaction
custTrans = CustTrans::findByVoucher(this.custInvoiceJour.LedgerVoucher);
custTrans.selectForUpdate(true);


// updating the customer transaction
ttsbegin;
custTrans.SLDTenderTypeName = ecomMethodOfPayment;
custTrans.update();
ttscommit;
}
}


Please feel free to contact me if you are facing any issue during implementation of this blog.







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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
d365technext: Default Dimension D365FO AX-2012 Blog bot DAX Blogs 0 03.09.2018 21:12
d365technext: Record sorting D365FO, AX 7 and AX-2012 Blog bot DAX Blogs 0 08.08.2018 21:12
d365technext: Environment Hot-Fixes List Using X++ D365FO & AX 7 Blog bot DAX Blogs 0 02.08.2018 18:12
d365technext: Flush the AOS cache from code. AX-2012 Blog bot DAX Blogs 0 31.07.2018 17:11
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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