Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

OData execution of a Quick Find savedquery

Posted on by

Hi all

I'm aware of the ability to execute a saved query/system view against an entity (GET [Organization URI]/api/data/v8.2/accounts?savedQuery=00000000-0000-0000-00aa-000010001002), but how do I add the search term if it's a Quick Find query? I know the FetchXML query has a value={0} element, but I can't pass in a "value" parameter - CRM errors saying "No Other Query options supported when SavedQuery or UserQuery or FetchXml option is provided".

Obviously the alternative is to just return the FetchXML, do the replacement of the {0}, and then execute that, but it seems inelegant compared to the ?savedQuery mechanism?

P.S. I'm doing this in JavaScript from a web resource, although I don't think that changes the question at all?

Thanks
James

  • ashlega Profile Picture
    ashlega 34,473 on at
    RE: OData execution of a Quick Find savedquery

    Sure.. Also, this may give you a bit more details on the internal "mechanics" of the Quick Find:

    www.itaintboring.com/.../configuring-quick-find-to-search-in-the-related-entities

    Basically, if you register a plugin in the pre-retrieveMultiple, you'll see how the search keyword is added to the filter conditions (which likely means that CRM is doing some client-side pre-processing before running that fetch, but, in the end, who knows)

  • James Profile Picture
    James on at
    RE: OData execution of a Quick Find savedquery

    Thanks Alex. That's unfortunate - I found the execution of the Saved Queries elegant. We need to mimic the Quick Find mechanism by default, so creating filters isn't going to do the trick, unfortunately. We'll stick to downloading the fetchXML, replacing the {0}, and executing that.

    I'm going to leave this open for 48 hours before marking as answer just in case someone knows of any additional information.

    Thanks

  • ashlega Profile Picture
    ashlega 34,473 on at
    RE: OData execution of a Quick Find savedquery

    Hi,

     I don't think you can do it that way - CRM take care of updating FetchXml when executing quick find (it does not pass a parameter to the fetch). So you might do the same - have a fetchXml there, update it for each query (add filters etc), then run that fetch.

     Or you can use filtering in Web API (without fetch):

    msdn.microsoft.com/.../gg334767.aspx

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,459 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,783 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans