Thursday 19 November 2020

Dynamic AX7 / D3FO: Adding display method

 Hi Folks :)

Today we will be looking at how we can add display method on forms.
Let’s say I would like to add a new display method on CustTable form.
In Dynamics 365 we won’t be able to add the new method or modify the existing method to the standard table or to an extension table.
It can be achieved by using the extension class.
Step 1: Create a new class and name it as <Classname>_<Extension>.
[ExtensionOf(tableStr(CustTable))]
public static class CustTable_Extension
{
}
Step 2 : Now add the display methods in the class which is required to be shown.
public static class CustTable_Extension
{
    [SysClientCacheDataMethodAttribute(true)] //This attribute will cache your display method.
    public static display Name customerGroupName(CustTable _this)
    {
        return CustGroup::find(_this.CustGroup).Name;
    }
 }

To use your display method on the form, create your new field on the form extension and use the property as below:




To cache your display method on the form set on the field the property “Cache Data Method” = yes if you don’t want to use the Attribute above.
 















**Things to remember**
·         The class must be postfixed with “_extension”.
·         The class must be static.
·         The extension methods must be static.
·         The type of the first parameter determines which type is extended.

Sunday 15 November 2020

Preview Journal Transactions

 Dynamics AX 2012 offers users a feature that allows them previewing vouchers before transactions are posted. The feature is called “subledger journal” and is – among others – available in the vendor invoice posting form for purchase orders and the free text invoice form. Even though the subledger journal feature does only illustrate the subledger part of a voucher, it can help users identifying errors before they post transactions.

Unfortunately, the journals that are available in the General Ledger (GL), Accounts Payable (AP) and Accounts Receivable (AR) module do not have a similar preview functionality. A possible workaround is printing a journal report as illustrated in the following screenshots. Yet, this report does not show the complete voucher as sales tax transactions are excluded.EN_1

Example

EN_2

One possibility to overcome this shortcoming is using the preview transactions form that is available for selected countries in Eastern Europe. Making this form available for other countries and users requires the following three minor system modifications:

  1. Adjust the Display Menu Item „LedgerTransPreview_RU“
    Simply add your country code in the properties of the menu item.EN_3
  2. Adjust the table „TmpLedgerTransPreview_RU”
    As before, simply add your country code in the table properties.EN_4
  3. Adjust Labels
    If you are unhappy with the default English translation, adjust the following two labels: @GLS104587 and @GLS104588

As a result of those modifications users can now identify a third option denominated “preview journal transactions” when they open the GL journal form. EN_5

Selecting this option opens the following window that allows a detailed preview of the vouchers included in the journal. EN_6

Please note that the same preview functionality automatically becomes available in the AP invoice journals, the AP payment journal and AR payment journals.