Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

Using FetchXML Builder in XRMToolbox to exclude results

Posted on by

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
    Nya 29,056 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
    Guido Preite 54,081 Super User 2024 Season 1 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

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans