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
PHPtoolkit and searching Custom Fields
I am currently working on integrating a local web app with data from Netsuite using the PHPtoolkit. However, I am (as of yet) unable to successfully build a function to search based on a custom field. My code (as of right now) looks like this:
[PHP]
if( !$myNSclient ) {
return "))<>((: Not logged into Netsuite";
}
if( is_nan($serial) ) {
return "))<>((: Serial number passed is not numeric.";
}
if ($serial != "") {
$itemSearch = new nsComplexObject("ItemSearchBasic");
$fields = array(
"customFieldList" => array(
"customField" => "custevent_tl_serial_num_case_form",
"operator" => "equals",
"searchValue" => $serial
),
);
$itemSearch->setFields($fields);
// Set search preferences
[PHP]
if( !$myNSclient ) {
return "))<>((: Not logged into Netsuite";
}
if( is_nan($serial) ) {
return "))<>((: Serial number passed is not numeric.";
}
if ($serial != "") {
$itemSearch = new nsComplexObject("ItemSearchBasic");
$fields = array(
"customFieldList" => array(
"customField" => "custevent_tl_serial_num_case_form",
"operator" => "equals",
"searchValue" => $serial
),
);
$itemSearch->setFields($fields);
// Set search preferences
0