Skip to content

Instantly share code, notes, and snippets.

@groggu
Created October 12, 2015 20:00
Show Gist options
  • Save groggu/3140f2475dce860dffa1 to your computer and use it in GitHub Desktop.
Save groggu/3140f2475dce860dffa1 to your computer and use it in GitHub Desktop.
Get an order records from NetSuite
//assumes you are using the PHPToolKit and have already
require_once 'lib/NetSuite/NetSuiteService.php';
$service = new NetSuiteService();
//if you have the internal ID
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = $nsOrderId;
$request->baseRef->type = "salesOrder";
$getResponse = $service->get($request);
//if you have the Transaction Id
$search = new TransactionSearchBasic();
$searchStringField = array('searchValue' => "SO1267816",
'operator' => 'is');
$search->tranId=$searchStringField;
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $service->search($request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment