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, ...
Unanswered

How to use "notexistjoin" in x++ query

(1) ShareShare
ReportReport
Posted on by 309

Hello people,

I'm trying to join 2 table which the idea is to get a set of records in tableA that does not exist in table B.

So I type a query like this : 

while select TableA
notexists join TableB 
                where TableA.ReceiptNum == TableB.receiptId
                   && TableA.IsClosed == NoYes::No
                   {
                   
                   }

I wonder whether this is correct because as you can see I have 1 more condition for Table A, but it seems in the while loop still retrieve records in TableA which "IsClosed=Yes"

Thanks,

I have the same question (0)
  • nunomaia Profile Picture
    25 Moderator on at

    Try to filter by on Table A 

    while select TableA
      where TableA.IsClosed == NoYes::No
    notexists join TableB 
                    where TableA.ReceiptNum == TableB.receiptId
                        
                       {
                       
                       }

  • Axel Cage Profile Picture
    309 on at

    Thank you, now it's correct. It seems in x++ the condition should be threaten one by one, is it ?

    Btw, one more thing and a bit OOT, when in the middle of debugging and I found something not correct, and then I press Stop, it seems it will continue the process first at backend, is it ? because when I see the record already wrong in the loop then stop, because it is actually a process to insert something, the insertion is still happen, although I already stop debug and bring me back to Edit mode in Visual Studio

    Thanks again.

  • nunomaia Profile Picture
    25 Moderator on at

    You should add all conditions that you want to filter in join

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 616

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans