Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Search not working when using two custom fields
I have two entity custom fields set up as free text fields. Each of them contain a default value when a customer is created.
This works when there's one custom field, but not two:
[PHP]
$itemSearch = new nsComplexObject("CustomerSearchBasic");
$itemSearch->setFields(array("email" => array( "operator" => "contains", "searchValue" => 'test@test.com')));
$myNSclient->setSearchPreferences(false, 10);
$searchResponse = $myNSclient->search($itemSearch);
if (!$searchResponse->isSuccess) {
echo "<font color='red'>" . $searchResponse->statusDetail[0]->message . "</font>";
} else {
echo "<font color='green'><b> - Found $searchResponse->totalRecords records</b></font>";
This works when there's one custom field, but not two:
[PHP]
$itemSearch = new nsComplexObject("CustomerSearchBasic");
$itemSearch->setFields(array("email" => array( "operator" => "contains", "searchValue" => 'test@test.com')));
$myNSclient->setSearchPreferences(false, 10);
$searchResponse = $myNSclient->search($itemSearch);
if (!$searchResponse->isSuccess) {
echo "<font color='red'>" . $searchResponse->statusDetail[0]->message . "</font>";
} else {
echo "<font color='green'><b> - Found $searchResponse->totalRecords records</b></font>";
0