Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

data is not displaying in Form - LedgerTransSettled in AX 2009

(0) ShareShare
ReportReport
Posted on by 6

Hi All,

GL - Periodic - Ledger Settlements. 

I have settled 2 transactions

I have checked in Ledger Settlement table, Settle Id got created

0876.j1.jpg

Now I go to particular main account 002130 > Transaction > Select that particular vouchers > Ledger settlements button

0407.j2.jpg

It's showing the recid but data is not display in form.

Form - LedgerTransSettled

form - init

public void init()
{
    super();

    checkInRed = LedgerParameters::find().NegativeAmountsInRed_CN;
}

set criteria

void setCriteria()
{
    LedgerTrans             ledgerTransLocal = element.args().record();
    LedgerTransSettlement   ledgerTransSettlementLocal;
    ;
    select ledgerTransSettlementLocal
        where ledgerTransSettlementLocal.TransRecId == ledgerTransLocal.RecId;

    if (ledgerTransSettlementLocal)
    {
        settleId = ledgerTransSettlementLocal.SettleId;
    }
    else
    {
        settleId = SysQuery::valueEmptyString();
    }

    ledgerTransSettlement_ds.query().dataSourceTable(tablenum(LedgerTransSettlement)).clearRanges();
    ledgerTransSettlement_ds.query().dataSourceTable(tablenum(LedgerTransSettlement)).addRange(fieldnum(LedgerTransSettlement, SettleId)).value(settleId);
}

ledgerTrans - init

public void init()
{
    ;
    super();

    if (LedgerParameters::find().ShowAmountDebitCredit_CN)
    {
        ledgerTrans_AmountCur.visible(false);
        amountCurDebit.visible(true);
        amountCurCredit.visible(true);
        ledgerTrans_AmountMST.visible(false);
        amountMstDebit.visible(true);
        amountMstCredit.visible(true);
    }
    else
    {
        ledgerTrans_AmountCur.visible(true);
        amountCurDebit.visible(false);
        amountCurCredit.visible(false);
        ledgerTrans_AmountMST.visible(true);
        amountMstDebit.visible(false);
        amountMstCredit.visible(false);
    }
}

ledgerTrans - display option

public void init()
{
    ;
    super();

    if (LedgerParameters::find().ShowAmountDebitCredit_CN)
    {
        ledgerTrans_AmountCur.visible(false);
        amountCurDebit.visible(true);
        amountCurCredit.visible(true);
        ledgerTrans_AmountMST.visible(false);
        amountMstDebit.visible(true);
        amountMstCredit.visible(true);
    }
    else
    {
        ledgerTrans_AmountCur.visible(true);
        amountCurDebit.visible(false);
        amountCurCredit.visible(false);
        ledgerTrans_AmountMST.visible(true);
        amountMstDebit.visible(false);
        amountMstCredit.visible(false);
    }
}

ledger trans - lincActive

public void linkActive()
{
    element.setCriteria();
    super();
}

As per the set criteria method, it should display the data in form. But why data is not displaying in form ?  is it BUGS?

Note - During debugging I have found the settled SID-712706 id also in set criteria method but data not displaying in form.

Please let me know the exact reason. We need to confirm business user tomorrow. 

Please give me more shed on this.

thanks!

  • Verified answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    I don't have access to the environments right now but I can guess.

    Both forms you use have the ledgerTrans table. In ledgerTrans, there is the relationship ledgerTrans --> ledgerTrans (the relationship in Dynalink). Naturally ax creates automatic relationship

    Actually, you're not as unfamiliar with Dynalink as you think.

    For example, when you open a second form on an order, have you ever thought why only the relevant order's information is displayed? Although we do not write any code at many points, related records come in the second forms. These are all advantages from dynalink. I recommend you to read the doc article I shared above.

  • @rp@n Profile Picture
    6 on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Thanks Martin for your reply.

    Sorry , not understand fully. Kindly give me example based on LedgerTransSettled form?

  • Martin Dráb Profile Picture
    231,983 Most Valuable Professional on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    If your question is answered, don't forget to mark the verified anwer(s).

    As mentioned above, dynalinks are normally created automatically by the system, not explicitly in code. The system checks if there is a relation between the table passed to a form as a parameter (don't forget that menu item buttons automatically pass the active record) and the primary data source of the called form. If so, it creates a dynalink.

  • @rp@n Profile Picture
    6 on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Hi Ergun,

    As discussed, I have duplicate the LedgerTransSettled from and added one line of code in form > DS> INIT > after super to clear the dynalink.

    And I have created a separate new menu item for this form because my requirement is for MY/THA legal entity. And I left the original form as it is without disturbing the code.

    It's working fine as expected.

    My only one question is , in the original form which code actually create a dynalink between two forms? that I not able to found.

    pls give me more shed on this.

    thanks!

  • Verified answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    "Dynamic links are created by using the Application Object Tree (AOT), without writing any code."

    docs.microsoft.com/.../how-to-link-two-forms-by-using-dynamic-links

    Of course, it is possible to add it with code (in the example I shared, it adds a new link after clearing the existing links, but in your case you will just clean it)

    Remove/Add 

    community.dynamics.com/.../ax-2012-add-remove-dynalink-through-x

  • @rp@n Profile Picture
    6 on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Hi Ergun,

    You mean to say form - DS - init method ?

    Kindly let me know which code creating a dynalink ?

    Please give me more shed on this 

    thanks!

  • Verified answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Dynalink come automatically via relations (table/edt). What you must do is clean it at form/ds init

    form.init (after super)

    TableName_ds.query().dataSourceTable(tableNum(TableName)).clearDynalinks();

  • @rp@n Profile Picture
    6 on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Ergun,

    Pls let me know, where is define the dynalink between 2 forms? Is it in properties level?

    I have not found any relation

    Pls give me more shed on this 

    Thanks!

  • @rp@n Profile Picture
    6 on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    Hi Ergun 

    My requirement is for another legal entity. 

    Please give me more shed on this 

  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: data is not displaying in Form - LedgerTransSettled in AX 2009

    http://codingchamp.blogspot.com/2014/09/remove-dynalinks-between-forms-in.html?m=1

    Let me remind you again. There must be a reason for establishing a relationship in the localization.

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... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans