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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Facing Issue

(1) ShareShare
ReportReport
Posted on by 10
PaymMethod
NamePaymMode
CashCASH
ChequeCHEQUE
OnlineONLINE
Post Dated ChequePDC
 
  1. I want to fetch data from PaymMethod table
  2. Then I want to count PaymMode from PaymMethod and store into a variable named as “int
Size”}
  1. Then I want to add PaymMethod into list
  2. I want to query data from retailtransactiontable, retailTransactionSalesTrans and retailTransactionPaymentTrans based on 1st element of list.
  3. When second time query run it will fetch from retailtransactiontable, retailTransactionSalesTrans and retailTransactionPaymentTrans based on 2nd  element of list and so on.
Class final test
{
               Int Size;
               List MyList = new List (Types::string);
               Size= select count(PaymMode) from PaymMethod.
Int array[size];
For(1=0, i<size, i++)
               Select paymMode from PaymMethod
               MyList.addend(PaymMode, PaymMode)

Finaly I want to run this query to fetch the data on base of payment method from retail transaction sales trans.
Select * from retailtransactionsalestrans where Paymentmethod == conpeek(MyList ,1)
When 2nd query run it will fetch data from retailtransactionsalestrans  where paymentmethod= conpeek(Mylist,2)

How can I achieve that



 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Can you please provide more details and show us the actual code you wrote? -- so that we understand more?
    Also what are you trying to do after you select from retailTransactionSalesTrans?

    Trying to make it work based on the code you provided without changing it alot, and assuming I understood what you are tying to achieve. Then  you can loop through the list, and inside it, do the "select retailTransactionSalesTrans where retailTransactionSalesTrans.Paymentmethod == listEnumerator.current()" 

    maybe sth like this:

    ListEnumerator myListEnumerator = MyList.getEnumerator();
     if(myListEnumerator)
     {
             while (myListEnumerator.moveNext())
             {
                select  retailTransactionSalesTrans where retailTransactionSalesTrans.Paymentmethod == myListEnumerator.current();
             }
     }

    Thanks,
    Layan Jwei
  • Martin Dráb Profile Picture
    238,782 Most Valuable Professional on at
    Dear User, please use a title for your thread that describe the topic. "Facing Issue" is way too vague; that could be a title of every single thread (and this forum would become unusable, because no one would be able to locate relevant threads).
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    Have you tried to write the code for the function you want to achieve? If so, you can share the code so that you can get help better.
    Best Regards,
    Hana
     
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    My understanding is to count the number of PaymMode from PaymMethod table which will add to a list or array. Then you need to loop through that list and for every list iteration, you need to select value from retailtransactiontable, retailTransactionSalesTrans and retailTransactionPaymentTrans.
     
    My 1st question is if you are selecting number of PaymMode, assuming there are 3, then it gives 3. So, first element would be 1. So, you cannot get any record here with 1 as it is not a unique key in these tables to identity the buffer. 
     
    If in case you need to make a list with the records of that PaymMethod  table, then you will have unique key to identity the buffer.
     
    My 2nd question point is you I think you cannot pass a list in place of a container.
     
    So, your code is correct but with some syntax errors like passing list instead of a container.
     
    So, code flow would be to select records of PaymMode, creating correct List type, then looping through list and selecting value form the mentioned 3 tables.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 512 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 386

#3
Adis Profile Picture

Adis 259 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans