Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Microsoft Dynamics AX 2009 : Changing automatic transaction text

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/23/2011 6:35:58 PM
Every financial transaction in Dynamics AX can (and normally should) have a descriptive transaction text. Some texts are entered by user, some are generated by the system. The latter option happens for automatically generated transactions where the user cannot interact with the process.

Dynamics AX provides a way to define texts for automatically generated transactions. The setup can be found in Basic | Setup | Transaction text. Here the user can create custom transaction texts for various automatic transaction types and languages. The text itself can have a number of placeholders digits with percent sign in front of them, which are replaced with actual values during the process. Placeholders can be from %1 to %6 and they are replaced with the following values:

  • %1: the transaction date

  • %2: a relevant number like invoice, delivery note, etc.

  • %3: the voucher number

  • %4-%6: custom; depends on the module

Although most of the time the existing values are enough, I was still requested a number of times to add additional ones. One of the latest requests was to include the vendor name into vendor payment journal lines automatically generated by payment proposals. We will use this case as an example in this recipe.

Getting ready

First we need to make sure the vendor payment transaction text is set up properly. Open Basic | Setup | Transaction text, find a line with Vendor - Payment, Vendor and change the text to Payment to %5 like the following:

How to do it...

  1. 1. Open AOT, find the CustVendPaymProposalTransferToJournal class and add the following code to its getTransactionText():

    transactionTxt.setKey2(
    _custVendPaymProposalLine.custVendTable().Name);
  2. right after:

    transactionTxt = new TransactionTxt(
    LedgerTransTxt::VendPaymentVend);
  3. 2. Open Accounts payable | Journals | Payments | Payment journal and create a new journal. Then create payment lines using the Create payment proposal function. Notice that now the transaction texts include vendor name:

How it works...

The lines generated by vendor payment proposals are transferred into the journal by using the CustVendPaymProposalTransferToJournal class. Its getTransactionText() method is responsible for formatting transaction texts. If we look inside it we can see that the TransactionTxt class is used for this purpose. The following methods are used for each placeholder:

  • %1: setDate()

  • %2: setFormLetter()

  • %3: setVoucher()

  • %4: setKey1()

  • %5: setKey2()

  • %6: setKey3()

By looking at the code we can see that only %4 (setKey1()) is used, so we can occupy %5 and fill it with the vendor name. To achieve that, we have to call setKey2() with the vendor name as an argument. We place the code in the ModuleCustVend::Vend section of the switch statement to make sure it is executed only when generating vendor payments.

There's more...

If more than 3 custom placeholders are required it is always possible to add an additional one by creating a new setKey() method in the TransactionTxt class. For example, if we want to add placeholder %7 we have to do the following:

Add the following code to the class declaration:

str 20 key4;

Create a new method:

void setKey4(str 20 _key4)

{;
key4 = _key4;
}

Change the last line of the txt() method to:

return strfmt(
txt,
transDate,
formLetterNum,
voucherNum,
key1,
key2,
key3,
key4);

After those modifications we can use setKey4() when generating transactions.

Although even more placeholders could be added, it should be considered that the transaction text field has a finite number of characters and excessive text will be simply truncated.

Other -----------------
- Microsoft Dynamics AX 2009 : Creating and posting ledger vouchers
- Planning the Installation : Installation Scenarios for IIS 7.0 (part 3) - Server Core Web Edition Server Workload
- Planning the Installation : Installation Scenarios for IIS 7.0 (part 2) - IIS Managed Modules and .NET Extensibility Server Workload & IIS Full Install
- Planning the Installation : Installation Scenarios for IIS 7.0 (part 1)
- Sharepoint 2010 : Configuring Crawls (part 3) - Using Server Name Mappings & Controlling Host Distribution
- Sharepoint 2010 : Configuring Crawls (part 2) - Creating and Managing Crawl Rules
- Sharepoint 2010 : Configuring Crawls (part 1) - Creating and Managing Content Sources
- Windows Server 2003 : Creating and Enforcing Security Policies (part 3) - Microsoft Baseline Security Analyzer
- Windows Server 2003 : Creating and Enforcing Security Policies (part 2) - Security Configuration and Analysis
- Windows Server 2003 : Creating and Enforcing Security Policies (part 1) - Using Security Policy Templates
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server