We are using C# with Swagger definition to access a Web Service Endpoint
We are attempting to perform a filter on the SalesOrderClient GetListAsync and would like to perform a substringof filter on the OrderNbr field to find any orders that contain the value that has been specified.
SalesOrderClient soClient = new SalesOrderClient(httpClient);
soClient.BaseUrl = "http://localhost/Acumatica_DEV/entity/Test/20.200.001";
select = "OrderNbr, OrderType, Status, CustomerID, Details/LineNbr, Details/InventoryID, Details/OpenQty";
filter = "substringof(OrderNbr.Value, '" + e.RequestData.OrderNumber + "')";
filter = "OrderType eq 'SO' and Status eq 'Open'";
IEnumerable<SalesOrder> salesOrders = await soClient.GetListAsync(select, filter, "details", "", null, null);
foreach (SalesOrder salesOrder in salesOrders)
// Process Results
When we execute the search the error returned is
Unable to cast object of type 'System.String' to type 'PX.Api.ContractBased.Models.EntitySearchField'.
Is there a way to apply the substring, startswith or endswith filters here?
Best answer by Dmitrii NaumovView original