How to create a Search in SuiteTalk using multiple criteria?

Is it possible to create a Search in SuiteTalk using multiple criteria? I need to search for specific Location and items, using AND/OR logical operators. Something like location = 123 AND (item = 1 OR item = 2).

My code so far returns the result for a given location, but I need only 20-30ish items (not the 1400 i have in the warehouse. The location and the items change in every search, so I need to pass an array of items as filter/criteria.

My code so far

$searchValue = new RecordRef();

$searchValue->type = 'location';

$searchValue->internalId = 123;
$searchMultiSelectField = new SearchMultiSelectField();

setFields($searchMultiSelectField, array(

'operator' => 'anyOf',

'searchValue' => $searchValue

));

$locationSearchBasic->internalId = $searchMultiSelectField;

$itemSearch->inventoryLocationJoin = $locationSearchBasic;

$itemSearchAdvance->criteria = $itemSearch;
$request = new SearchRequest();

$request->searchRecord = $itemSearchAdvance;

$searchResponse = $service->search($request);
Beginner Asked on March 11, 2021 in SuiteTalk.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor