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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

FetchXML Except / Anti Join

(0) ShareShare
ReportReport
Posted on by 5

I'm looking for assistance on how to perform an Except or Anti-Join using FetchXML. For instance: 

ResourceTable: [1, 2, 3, 4, 5]

ResourceBookingTable: [3,4,3,3,5] (Filtered by time)

ResourceTable SubGrid Result: [1,2,4] 

(essentially: Don't show records in Table1 that have a record in Table2)

Intent:

To display resources that aren't booked during a specific time period in a form subgrid. The subgrid is filtered by date values on the form.

The current approach involves using a link-entity filter with FetchXML.

I can filter both Resource Table and the Booking Table, however, I haven't spotted a way to exclude ID's present in the filtered Booking Table from the Resource Table.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Check this article - it might point you the right direction - learn.microsoft.com/.../use-fetchxml-left-outer-join-query-records-not-in

  • Suggested answer
    MDev44 Profile Picture
    5 on at

    Confirming I'd already read through that prior to my post... it didn't fir my scenario.

    I just solved the problem though - I wrote the SQL statement and reversed it using SQL 4 CDS on XrmToolBox.

    http://sql2fetchxml.com didn't work in this instance.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Can you please provide the FetchXml that demonstrates your joins and didn't work?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Syed Aqib Raza Profile Picture

Syed Aqib Raza 125

#2
ParthPatel249 Profile Picture

ParthPatel249 87

#3
11manish Profile Picture

11manish 85 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans