Developer forum

Forum » Development » Order Search filter using Custom order fields

Order Search filter using Custom order fields

Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

OrderSearchFilter filter = new OrderSearchFilter();

filter.SearchCustomerFields = "OrderCustomfield=1";
var orderList = orderService.GetOrdersBySearch(filter);

any good example to search orders using Order custom fields?


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

If you want to search for values in CUSTOM fields, set OrderSearchFilter.SearchInCustomOrderFields to true

SearchCustomerFields is searching in the CUSTOMER fields:

Searching for one word:
filter.SearchCustomerFields = "Nicolai";

Searching for a phrase
filter.SearchCustomerFields = "\"Nicolai Pedersen\"";

 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Hi Nicolai

Thanks for the explanation 

if i want to search one order custom field value, something like CustomerOrderfield=1, any possible way of doing it?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Currently not.

Best option is maybe to do a simple SQL on the database returning only the orderids using your criteria, and then pass those orderids to the orderservice.

BR Nicolai

Votes for this answer: 1
 
Shiwanka Chathuranga Dynamicweb Employee
Shiwanka Chathuranga
Reply

Thanks Nicolai

 

You must be logged in to post in the forum