Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Default descriptions - Key1-Key3 definitions

(0) ShareShare
ReportReport
Posted on by 140

I am setting up my default desriptions for various transactions and the default text is defined by selecting %1- %6. However %4-%6 are just defined as correlating to Key1-Key3 for the transaction selected. Does anyone know what Key1 , Key 2 and Key3 mean or relate to and how I can find out what they are for the various types of transactions listed? Thanks!

*This post is locked for comments

  • RE: Default descriptions - Key1-Key3 definitions

    Default descriptions can be specified in AX2012 here:

    Organization administration > Setup > Default descriptions

    When a default description with no specified parameters is selected a little misleading default text is displayed in the Optional variables textbox: %4 - %6 = Key1 - Key3. This text is coming from the Forms\TransactionTexts\methods\setFormParametersText method, and displayed only if there is no parameters were added.

    img9.png

    As soon as a parameter is selected this text is replaced, based on the selected fields:

    4503.img2.png

    Any field can be added on the grid from the tables available in the lookup of the Reference table column.

    2845.img4.png

    Adding fields on the parameters grid is not enough to get the wanted default description text, the selected optional variables should also be referenced in the Text field. Here the string should be inserted manually, it is not generated automatically by the system:

    6560.img5.png

    The list of the selectable tables is specified in one of the subclasses of the TransactionTextContext Class:

    6560.img6.png

    If you need a field value that is not coming from the available tables you have to modify the subclass containing the definition of the context for the selected default description.

    First you have to find the element for the default description in the LedgerTransTxt base enum:

    img7.png

    In this test example the element is PurchInvoiceLedger. Searchching for this element name returns the subclass that implements the context for our default description:  

    img8.png

    As you can see in the class declaration this context is used for several source document type, so you have to be careful, because a modification can affect other default descriptions too.

    img9.png

    If you want to add a third table to this context than you should modify each method in this class following the patterns in them.

    You also have to search the system where this LedgerTransTxt element is used and add a setKey3 and a setTableBuffer method call.

    img10.png

    You must use a single key field value as a parameter for the setKey1 - setkey3 methods. If the table does not have a single key you can use recid, but you have to convert the value using int642str as the method signatures contain a string type. So the Key1- Key3 in the default text means that the single key field of the buffer should be given to the setKey1 – setkey3 methods as a parameter.

    You can also create a totally new description if needed. Lets say you have to create a new default description  for a special movement journal that has a specific journalname value saved in the inventparameters. You have to add a new element in the LedgerTransTxt enum and implement a new subclass of TransactionTextContext base class. Than you have to modify or override the method that creates the transaction text using the newly implemented context. In this example  you have to override the JournaCheckPostLedger.ledgerTransTxt method in InventJournalCheckPost_Movement subclass to use the newly implemented context when the journaltable contains the specific journal name.

  • RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Dear Susie,

    I have the same issue, currently we have AX 2012 R2 with CU7, the problem is according to this document I am unable to find the update for the same.

    blogs.msdn.microsoft.com/.../how-to-enable-add-other-text-to-default-descriptions-feature-in-all-countries

    Please suggest.

  • faheem Ahmed Profile Picture
    faheem Ahmed 450 on at
    RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Bruce you can customize just follow below mention steps.

    1:Add one more key in \Classes\TransactionTxt its fairly easy open the class and follow the

    pattern.

    lets say your key is setInvoiceDescription

    now go to

    2:\Classes\VendorInvoiceSourceDoc\parmTransactionText

    just past this line and you are done.

    transactionTxt.setInvoiceDescription(VendInvoiceJour::findFromPurchId(vendInvoiceMap.PurchId).Description);

    3:code part is complete:

    define new key %6 in OrganizationAdministration\Setup\Default descriptions

    generate CLI and it should appaer now you can define as many key you want following the same logic.

  • RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    I have just come across this. Is there any way to customise the Keys?

    I am looking to add VendInvoiceInfoTable.Description if possible. Every detail from the VendInvoiceInfoTable seems to be available apart from the description - arguably the most important part in terms of analysis.

  • RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Does anyone know if this can be pulled into Management Reporter?

  • Suggested answer
    faheem Ahmed Profile Picture
    faheem Ahmed 450 on at
    RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    You can check TransactionTxt class, for every default description this class is called.

    return strfmt(txt, date2StrUsr(transDate, DateFlags::FormatAll), formLetterNum, voucherNum, key1, key2, key3);

    it will always return this string but values will change depending on type you select so there are only 6 possible value.  

  • RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Hi we have added the Purchase - invoice, ledger.

    Do you know how to add the Purchase Order number to the description? I have found:

    %1 = Trans Date

    %2 = Invoice no (external)

    %3 = Voucher

    %4 = Supplier No.

    %5 = Supplier Group

    In Purchase order - product receipt, ledger - %4 = the PO number

    Do you know if Microsoft ever posted a list of all of the types?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,516 Super User 2025 Season 1 on at
    RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Hi AX-2012 Updates,

    The list above is still valid. These keys are variables used to fill a description. If it is already filled like you describe.... Can you explain further?

  • AX-2012 Updates Profile Picture
    AX-2012 Updates 205 on at
    RE: Default descriptions in Ax 2012- Key1-Key3 definitions

    Can you please tell me How can i take vendor Invoice description by using default description, which key i need to select..? 

    Thanks in advance

  • Susie Hadley Profile Picture
    Susie Hadley 140 on at
    Re: Default descriptions in Ax 2012- Key1-Key3 definitions

    Thanks for the insight!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans