Run quick search using REST?

Pretty straightforward question. I’ve got the endpoint https://myepicorserver/E10Pilot/api/v2/odata/MyCompany/Ice.BO.QuickSearchSvc/RunQuickSearch, and I see it expects parameter “ds”. I recognize ds from writing BPMs but can’t figure out what data to actually POST in order to get quick search results.

Any ideas?

A quick search is just a BAQ… so why bother going with the Quick Search Business Object? Just run the BAQ?

2 Likes

The BAQ for a quick search returns all rows and the criteria on the quick search does the filtering/searching, doesn’t it? At least on this quick search, the BAQ returns ALL customers and the quick search has a criteria “Customer_Name MATCHES Prompt”. Did I build that backwards? Am I supposed to prompt from the BAQ?

Sure but a Quick Search is just for filtering the BAQ… If you are using REST you can filter the BAQ at the BAQ End Point
Just pass in your filters in the $filter query parameter (as any standard OData Call)

Here’s a pretty comphensive list of the operators and operations you can use

3 Likes

The substringof() function doesn’t work, but using “$filter=indexof(Customer_Name, ‘partialname’) gt 0” does

Thank you.

1 Like

But the real question is “Is the REST quick search quicker than the quick search”?

In addition to filtering, you’ll see that you can also pass in your BAQ parameters on the URL.

https://EpicorApp/Epicor10/api/v1/BaqSvc/myBAQ?startDate='2020-0305'&endDate='2010-03-06'

The REST guide has the details including the required date format.

1 Like

Additionally, for my purposes it’ll be sufficient to simply use Erp.BO.CustomerSvc/Customers?$filter=

Thank you for the brief introduction to odata

Quick FYI, the payload for the Customer Business Object will be significantly larger than the BAQSvc. In the future, your 10.2.500+ future, you can put all of this functionality in an Epicor Function which will make calling this easier from multiple places while keeping all the code in one easy to maintain function.

2 Likes

I have given myself a daunting task of replacing our customer ordering web app with functions in lieu of standard BO calls for just this reason

2 Likes

this is for calling the whole BO service but when using BAQ the filter code is a bit different

https://EpicorDomain/EpicorEnvironment/api/v1/BaqSvc/BaqID(Company)/?$filter=TableName_FieldName eq 'Value'