web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,897 Super User 2025 Season 2 on at
    RE: Repeated records in my query

    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
    RE: Repeated records in my query

    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
    RE: Repeated records in my query

    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
    RE: Repeated records in my query

    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans