Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Using FetchXML Builder in XRMToolbox to exclude results

(0) ShareShare
ReportReport
Posted on by 2

Hi,

I'm having issues with a system view and have been struggling to build my view in FetchXML Builder.

The requirement is for a system view to display a list of 'Resource Requirements' that has a 'Bookable Resource Booking' - 'Booking Status' that DOES NOT EQUAL 'Transfer', the issue is that 'Resource Requirements' can have multiple 'Bookable Resource Bookings' with different 'Booking Statuses'. 

Therefore, if a 'Resource Requirement' contains a 'Bookable Resource Booking' with Booking Statuses of 'Transferred' and another Booking Status of 'Acknowledged' then it will show up in my system view.

Is there any way I can exclude all 'Resource Requirements' in my system view if even one 'Bookable Resource Booking' contains a 'Booking Status' of 'Transfer?

  • Suggested answer
    Nya Profile Picture
    29,058 on at
    RE: Using FetchXML Builder in XRMToolbox to exclude results

    Hi,

    So what you need is to show all the 'Resource Requirements' that do not have a 'Bookable Resource Bookings' status of "Transferred".

    Such traversal is not supported in FetchXML, you can switch from FetchXML builder to SQL 4 CDS to perform the query.

    pastedimage1645002489478v3.png

    Please refer to the following link for the SQL.

    sql - find all parent records where all child records have a given value (but not just some child records) - Stack Overflow

  • Guido Preite Profile Picture
    54,075 Moderator on at
    RE: Using FetchXML Builder in XRMToolbox to exclude results

    what I am going to write here I didn't test, so it's just the first thoughts after I read your question.

    If you are able to create a view inside FetchXML Builder to filter the Resource Requirements in the way you need, I am not sure this kind of query can be saved to a view (fetchxml with grouping that is usually done in your scenario can't be saved as views)

    You will need some indicator at Resource Requirement level if there are some BRB connected with the status 'Transfer' or not. You can try first with a calculated field (maybe dealing with the BRB Name to be copied over if is 'Transfer'?) and if doesn't work then you need a plugin (I know it sounds exaggerated but I don't have other suggestions)

    After this indicator is on Resource Requirement the view become very simple to create

    hope it helps

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... 293,202 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans