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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
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