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.
Look up a SalesOrder with getList & PHP Toolkit
I recently wrote a PHP script utilizing the PHP Toolkit 2008.2.r3 to do a getList request on an array of internal customer ids. I was very happy with how this script works. The script is simple: [PHP]include('login.php');
$idA = array(16779,16681); // array of valid customer internal ids
$recordRefs = array();
for ($i = 0; $i < count($idA); $i++)
{
$custRef = new nsRecordRef();
$custRef->setFields(array('internalId' => $idA[$i],'type' => 'customer'));
$recordRefs[] = $custRef;
}
try
{
$response = $myNSclient->getList($recordRefs);
print_r($response);
}
catch (Exception $e){print_r($e);}[/PHP]
I thought it would be easy to modify to look up sales orders:[PHP]include('login.php');
$idA = array(16779,16681); // array of valid customer internal ids
$recordRefs = array();
for ($i = 0; $i < count($idA); $i++)
{
$custRef = new nsRecordRef();
$custRef->setFields(array('internalId' => $idA[$i],'type' => 'customer'));
$recordRefs[] = $custRef;
}
try
{
$response = $myNSclient->getList($recordRefs);
print_r($response);
}
catch (Exception $e){print_r($e);}[/PHP]
I thought it would be easy to modify to look up sales orders:[PHP]include('login.php');
0