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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Getting Amount in Transaction Currency and amount in Reporting Currency

(0) ShareShare
ReportReport
Posted on by

For Each PurchLine which is  invoiced, i am trying to get the Amount in Transaction Currency and Amount in Reporting Currency from Voucher Transaction .I  used generalJournalEntry generalJournalEntry.SubledgerVoucher== vendInvoiceJour.LedgerVoucher and generalJournalAccountEntry.GeneralJournalEntry==generalJournalEntry.recid;

Is this the right way of approachin?I think i am proceding wrongly.

Please Help!!

 

 

ScreenShot01.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    305,299 Super User 2026 Season 1 on at

    Hi Varun,

    I'm not able to check the correct table names at this moment, but the query you are using is getting accounting entries without considering the number of lines. Also accounting entries can be posted as a summary of multiple lines. On the purchase order form you can view the accounting events/distribution on the header and line level. Check these form for the data model being used. There are dome links to tables with the fields SourceDocumentHeader and SourceDocumentLine.

  • Community Member Profile Picture
    on at

    Below is the query i used i am genrating a excel export

    while select vendInvoiceJour where vendInvoiceJour.InvoiceDate>=fromDate && vendInvoiceJour.InvoiceDate<=toDate
        {
            while select purchLine
            join purchtable
            where purchLine.PurchId == purchtable.purchId
            && purchtable.purchId==vendInvoiceJour.PurchId
            {
                row++;

    select generalJournalEntry where generalJournalEntry.SubledgerVoucher== vendInvoiceJour.LedgerVoucher;
                select generalJournalAccountEntry where generalJournalAccountEntry.GeneralJournalEntry==generalJournalEntry.recid;
                sysExcelWorksheetBackOrder.cells().item(row,11).value(strFmt("%1",generalJournalAccountEntry.AccountingCurrencyAmount ));
    }}

     

     

    You wanted me to check the data model use in Purchase Order Header and Line!!I could not understand .Can u please elobrate.how should i appraoch

  • Community Member Profile Picture
    on at

    query = new Query();
    datasource = query.addDataSource(tableNum(PurchTable));

    //VendInvoiceJour
    datasource = datasource.addDataSource(tableNum(VendInvoiceJour));
    datasource.joinMode(JoinMode::InnerJoin);
    datasource.relations(true);
    datasource.addRange(fieldnum(VendInvoiceJour,PurchId)).value(purchtable.purchId);
    datasource.addRange(fieldnum(VendInvoiceJour,InvoiceDate)).value(queryRange(fromDate,toDate));

    //VendInvoiceTrans
    datasource = datasource.addDataSource(tableNum(VendInvoiceTrans));
    datasource.joinMode(JoinMode::InnerJoin);
    datasource.relations(true);
    //PurchLine
    datasource = datasource.addDataSource(tableNum(PurchLine));
    datasource.joinMode(JoinMode::InnerJoin);
    datasource.relations(false);
    datasource.addLink(fieldNum(vendInvoiceTrans,PurchId), fieldNum(purchLine, PurchId));
    datasource.addLink(fieldNum(vendInvoiceTrans, PurchaseLineLineNumber), fieldNum(purchLine,LineNumber));

    //ACCOUNTINGDISTRIBUTION
    datasource = datasource.addDataSource(tableNum(AccountingDistribution));
    datasource.joinMode(JoinMode::InnerJoin);
    datasource.addLink(fieldNum(accountingDistribution, SOURCEDOCUMENTLINE), fieldNum(purchLine,SOURCEDOCUMENTLINE));

    qRun = new QueryRun(query);
    while(qRun.next())
    {
    vendInvoiceTrans = qRun.get(tablenum(VendInvoiceTrans));
    vendInvoiceJour = qRun.get(tablenum(VendInvoiceJour));
    purchLine = qRun.get(tablenum(PurchLine));
    accountDistribution = qRun.get(tablenum(AccountingDistribution));
    purchTable = qRun.get(tablenum(PurchTable));

    info(strfmt('%1 ,%2 , %3, %4 %5 , %6, %7 %8 %9 %10 %11 ',vendInvoiceJour.LedgerVoucher,
    vendInvoiceTrans.PurchID,
    vendInvoiceJour.InvoiceId,
    vendInvoiceTrans.ItemId,
    vendInvoiceTrans.Qty,
    vendInvoiceTrans.PurchUnit
    ,PurchLine.REMAINPURCHFINANCIAL,
    PurchLine.REMAINPURCHPHYSICAL,
    purchLine.RemainPurchFinancial
    ,purchTable.PurchName,
    purchLine.PurchStatus
    ));

    I don't know how to get generalJournalAccountEntry.AccountingCurrencyAmount and generalJournalAccountEntry.ReportingCurrencyAmount..Can some one please help

  • André Arnaud de Calavon Profile Picture
    305,299 Super User 2026 Season 1 on at

    Hi Varun,

    Check for possible relations using the tables AccountingEvent and SubledgerJournalEntry.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans