Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

How can I turn a while select into a Query?

Posted on by 102

How can I turn the code below into Query using only code and without using Query from AOT?

while select custInvoiceJour
    where ((invoiceAccount && custInvoiceJour.InvoiceAccount == invoiceAccount) || !invoiceAccount)
       && custInvoiceJour.InvoiceDate >= fromDate
       && custInvoiceJour.InvoiceDate <= toDate
       && ((salesId && custInvoiceJour.SalesId==salesId) || !salesId)
       && ((salesTaker && custInvoiceJour.WorkerSalesTaker==salesTaker) || !salesTaker)
    join custTable
        where custTable.AccountNum == custInvoiceJour.InvoiceAccount
    join dirPartyTable
        where custTable.Party == dirPartyTable.RecId
    join salesTable
        where salesTable.SalesId == custInvoiceJour.SalesId
        && ((salesResponsible && salesTable.WorkerSalesResponsible==salesResponsible) || !salesResponsible)

  • Ferhat.S Profile Picture
    Ferhat.S 231 on at
    RE: How can I turn a while select into a Query?

    You might wanna be have a look at this link: learn.microsoft.com/.../how-to-create-queries-by-using-x

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: How can I turn a while select into a Query?

    You'll need to write the code. Do you have any particular problem with it?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans