Показать сообщение отдельно
Старый 01.12.2021, 06:45   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsaxinsight: Add table to a default description
Источник: https://dynamicsaxinsight.wordpress....t-description/
==============

Purpose:

The purpose of this post is to demonstrate how can we extend default descriptions by adding a new table to the default description definition.

Application:

Dynamics 365 Finance and Operations

Prerequisites:
  • Understanding of how default descriptions work
Business requirement:

Use customer free text invoice line description field in the definition of Customer – tax invoice, customer default description.

Out of the box only two tables are available to select, CustInvoiceTable and CustInvoiceJour. The requirement is to add CustInvoiceLine.

Solution:

It can be achieved by developing an extension class of TransactionTextContextCust class.

Code

[ExtensionOf(classStr(TransactionTextContextCust))]final class TransactionTextContextCustMAK_Extension{ private CustInvoiceLine custInvoiceLine; /// /// Provides a list of tables that are supported for use with a specified transaction type. /// /// /// A container that contains a collection of TableId values of tables that are supported by a /// specified transaction type. /// public container getSupportedTables() { container tableList; tableList = next getSupportedTables(); tableList += tableNum(CustInvoiceLine); return tableList; } /// /// Sets the parameter variable of an object to contain the records that are used with a specified /// transaction type. /// /// /// This method must be called before the table fields and values are mapped for the transaction text /// setup parameters. /// public void setParameters() { next setParameters(); parameters = [custInvoiceJour, custInvoiceTable, custInvoiceLine]; } /// /// Set a particular table buffer for a specified transaction type. /// /// /// The Common record that is set based on the TableId value of the buffer. /// /// /// true if the table is supported and the buffer is saved; otherwise, false. /// /// /// The Common record is cast to the appropriate table through switch logic. /// This method can be called repeatedly to assign multiple buffers. /// /// /// The table is not supported by this transaction type. /// public boolean setTableBuffer(Common _common) { boolean tableBufferSet; tableBufferSet = next setTableBuffer(_common); switch (_common.TableId) { case tableNum(CustInvoiceTable): custInvoiceLine = CustInvoiceLine::findByParentRecId(custInvoiceTable.RecId); tableBufferSet = true; break; } return tableBufferSet; }}



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