web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to differentiate between credit and debit value

(0) ShareShare
ReportReport
Posted on by

Hi all

How to differentiate between credit and debit value on the same column through x++ ?

Thanks

*This post is locked for comments

I have the same question (0)
  • nunomaia Profile Picture
    25 Moderator on at

    Please, could you detail a little more or question?

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi,

    The picture shared is not visible to me. Can you retry share the picture, or explain your question in more detail?

  • Verified answer
    Community Member Profile Picture
    on at

    Credit amount will be negative value and debit value will be have positive value.

    When a field in table is exteded to Exteded Data type  AmountMSTDebCred it displays value in indented format for quick understanding purpose

    but if you assign that value to a ammount type field

    its will have vlaue with negative sign if credit amount

    Try validating following code

       LedgerTrans                     trans;

       Amount                          CreditDebitAmt;

       ;

       select trans    where trans.RecId == 5644448870; <<assign RecId as per your data>

       CreditDebitAmt = trans.AmountMST;

    Please verify and update with your findings

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Khiat,

    I'm now able to click on the 'image' and see the image. It is not clear which table you are referring to. You mentioned in a tag that this is related to AX2012, but I'm not convinced yet.

    The answer from Nitesh is almost correct. The mentioned table name by Nitesh is the Ledger transactions table in all AX versions until AX2009. The data model in AX2012 has been changed and the table where Ledger transactions are stored are two tables:

    GeneralJournalEntry

    GeneralJournalAccountEntry

    The last mentioned table contains the link to main accounts and used dimensions and the amounts.

    For this table and the LedgerTable from earlier versions, there are also a columns called 'IsCorrection' and 'IsCredit' (AX2009 'Correct' and  'Crediting').

    If you enter a negative value in the credit column of a journal, both fields will be set to true.

    In that case you can have a negative amount at the right side of this debit/credit column.

    If you purely read from the database in x++ code you get the value positive or negative directly.

    As it is not clear which table another not:

    Some other tables also have the field IsCorrection/Correct to manage display of the debit/credit column.

  • Community Member Profile Picture
    on at

    Thanks all for trying to help, but Nitesh Ranjan solved my issue.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans