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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Repeated records in my query

(0) ShareShare
ReportReport
Posted on by

while Select inventJournalTable
join inventJournalTrans
join inventTrans
join inventTransOrigin
where inventJournalTable.JournalId == inventJournalTrans.JournalId
&& inventTrans.InventTransOrigin == inventTransOrigin.RecId
&& inventJournalTrans.InventTransId == inventTransOrigin.InventTransId
&& inventJournalTrans.JournalId == "ICD-000016"

{
while select generalJournalEntry
where inventTrans.Voucher == generalJournalEntry.SubledgerVoucher
{
select generalJournalAccountEntry
where generalJournalAccountEntry.GeneralJournalEntry == generalJournalEntry.RecId;

i++;
info(strFmt("Journal : %1 , I : %2",inventJournalTrans.JournalId, i));
info(strFmt("Qty : %1",inventTrans.Qty));
info(strFmt("Voucher : %1", generalJournalEntry.SubledgerVoucher));
info(strFmt("Amount : %1", generalJournalAccountEntry.TransactionCurrencyAmount));

}

}

Please Check and run the job 

I am getting the repeated amount from generalJournalAccountEntry Please reply me soon .

*This post is locked for comments

  • André Arnaud de Calavon Profile Picture
    307,408 Super User 2026 Season 2 on at

    Hi Pravinjoshi,

    It is likely that one inventTransOrigin can have multiple InventTrans records. If you did not enable the Inventory paramter for automatic merge of inventory transactions, you can get depending on situations multiple records in the InventTrans. Have you verified this? Also note that one GeneralJournalEntry at least has two records in the GeneralJournalAccountEntry table. The account and also offset account.

    One more reason could be that you didn't filter on the Ledger field in the table GeneralJournalEntry. This field determines to what legal entity the transactions belong.

  • Suggested answer
    Shankar Das Profile Picture
    205 on at

    Your job would be fetching repeated amount since for generalJournalEntry subledgervoucher is same every time. I would suggest you to explain the issue in detail adding detail that you are going to achieve through this job. Also check the ERD (Entity relationship diagram) of all the tables that are mentioned in the job and find the data manually at first.

  • Community Member Profile Picture
    on at

    HI Shankar Das,

      Thanks for responding ,

      Here my issue is i want to that

    in Inventory Managment -> journal-> Movement

    Select  journal Id -> Lines

    after selecting Lines -> inventory -> transaction

    where i found the quantity now when I go to  Ledger -> finicial voucher

    from this form i need  amount in transaction with voucher ?

    I get all the details expect amount in transaction.

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The general solution on how to find information in tables have been explained in your other thread for the same problem:

    community.dynamics.com/.../217555

    In this thread, the same has been recommended: check what are the relations between those tables, use table browser and simple jobs to figure out how your tables are linking to each other based on the query ranges, and you will have your answer.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans