RE: How To create a Netsuite SuiteTalk Search with Logical OR ?

How does one create a Suitetalk search query specifying search terms including a logical OR operator ?

For example, I want to retrieve a customer whose email or company contains specific “word”. Here’s my code that works great for a single search term. It looks like adding another search term appears to create a logical AND.

 

I also tried to look at CustomerSearchAdvanced but I didn’t find anything useful.

 

Does anyone know if that is supported in 2020.2 wsdl version ?

 

 

var basicCustomerSearchByEmail = new CustomerSearchBasic()
{
companyName = new SearchStringField()
{
@operator = SearchStringFieldOperator.contains,
operatorSpecified = true,
searchValue = email
},
//email = new SearchStringField()
//{
//    @operator = SearchStringFieldOperator.contains,
//    operatorSpecified = true,
//    searchValue = email
//},
};
var searchResult = netSuiteService.Search(basicCustomerSearchByEmail);

 

nadeemkhoury Beginner Asked on November 3, 2020 in How To's.
Add Comment
1 Answers

Hi,

If you are using Netsuite SuiteTalk SOAP Web Service, chances are it is still not possible to add a logical OR when creating a saved search in your server-side code. If you can, you should create the OR filters into a saved search in Netsuite and then use the created saved search (by using its internal id).

However, if this is not possible, alternate solutions would be to create a RESTlet which can do the job for you for this particular implementation. Another alternate would be to use the Suitetalk REST services where it is possible to provide a query with logical OR operator.

Beware, it has its own limitations and we suggest that you read about them before implementing it.

Beginner Answered on November 5, 2020.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.