Service Connect LIKE Operator Question

Hello.

I am working on a a workflow to enter orders. I would like to look for existing orders where the PONum starts with a specific value. I am using the SalesOrder.GetList .NET method and I am trying to use the LIKE operator in the where clause filed.

Looks like this: PONum like ‘#1026 - %’ and CustNum = 353021

I have also tried begins and matches using the ‘%’ in different locations.

Do any of you have any ideas?

Thanks
Scott

You could try a BAQ via REST call?

You don’t have to create a BAQ if the REST services are enabled – just use an OData URL against SalesOrder.GetList. This URL worked for me (below). But you can use the startwith function in the $filter. Also, you can limit the results to just the PONum field with the $select statement.

https://[YourMachine]/[YourERPSite]/api/v1/Erp.BO.SalesOrderSvc/List?$select=PONum&$filter=startswith(PONum, '#1026 - ')

If you try this in a browser like Chrome, some of the characters will get escaped to look like this…

https://[YourMachine]/[YourERPSite]/api/v1/Erp.BO.SalesOrderSvc/List?$select=PONum&$filter=startswith(PONum%2C%27%231026%20-%20%27)

1 Like

In Service Connect, if all you want is the list, you might be better using a DB query instead of a BO. It seems to be a lot more efficient as long as you don’t need the associated objects to pass on to something else.

Hey Everyone,

Wanted to update you on this. The LIKE keyword in the concatenated where clause actually worked. My workflow had an error for another reason and it just happened to be right after my list call.

I am able to pull orders where a PONum begins with a specific string using the LIKE keyword and % wildcard.

Thanks for the responses and suggestions.

  • Scott