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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 10.11.2018, 09:20   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: D365: Reverse customer transaction in X++
Источник: https://dynamicsaxinsight.wordpress....action-in-xpp/
==============

Purpose:

The purpose of this document is to demonstrate how we can reverse a posted customer transaction through X++. The code below can be used as a script to automate reversal of posted customer transactions.

Product:

Dynamics 365 for Finance and Operations

Development:

Please find below the code which can be used to reverse a posted customer transaction. It will actually create and post a negative entry transaction against the transaction to reverse. Please note the code defaults reason code to “ERROR” while posting a reversal transaction. Once developed this can be triggered using the following URL:

https://usnconeboxax1aos.cloud.onebo...tTransReversalCode:

class MAKCustTransReversal extends TransactionReversal_Cust{ public static MAKCustTransReversal construct() { return new MAKCustTransReversal(); } public boolean showDialog() { return false; } public static void main(Args _args) { CustTrans custTrans; MAKCustTransReversal makCustTransReversal; ReasonTable reasonTable; ReasonCode reasonCode; ReasonRefRecID reasonRefRecID; InvoiceId invoiceId; Args args; ; invoiceId = "3392"; reasonCode = "ERROR"; reasonTable = ReasonTable::find(reasonCode); reasonRefRecID = ReasonTableRef::createReasonTableRef( reasonTable.Reason, reasonTable.Description); custTrans = CustTrans::findFromInvoice(invoiceId); if (custTrans.RecId && !custTrans.LastSettleVoucher) { args = new Args(); args.record(custTrans); makCustTransReversal = MAKCustTransReversal::construct(); makCustTransReversal.parmReversalDate(systemDateGet()); makCustTransReversal.parmReasonRefRecId(reasonRefRecID); makCustTransReversal.reversal(args); info(strFmt("%1 %2 %3 %4 reversed.", custTrans.Voucher, custTrans.TransDate, custTrans.Invoice, custTrans.Txt)); } }}

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

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxinsight: AX7/D365/Operations: Create customer postal address through data entity from .NET console application Blog bot DAX Blogs 0 20.09.2017 15:11
dynamicsaxinsight: AX7/D365/Operations: Create Details Master pattern form Blog bot DAX Blogs 0 14.09.2017 13:11
dynamicsaxinsight: AX7/D365/Operations: Create custom data entity Blog bot DAX Blogs 0 14.09.2017 13:11
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Inside Dynamics AX 4.0: Transaction Semantics Blog bot DAX Blogs 0 31.10.2007 23:40
Опции темы Поиск в этой теме
Поиск в этой теме:

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

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

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

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