Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How can I turn a while select into a Query?

(0) ShareShare
ReportReport
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
    238 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
    231,762 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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,884 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,762 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans