Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
php - limit by subsidiary and transaction type
Hi,
I have script now that can pull transactions for a date range but want to only pull salesorders and invoices for a subsidiary.
for($a=0;$a<365;$a++)
{
unset($itemSearch);
$itemSearch = new nsComplexObject('TransactionSearchBasic');
$sum = 20+$a;
$sum2 = 21+$a;
$date = date("Y-m-d",mktime(0,0,0,4,$sum,2009));
$date2 = date("Y-m-d",mktime(0,0,0,4,$sum2,2009));
echo"\n$date <br>";
$itemSearch->setFields(array("dateCreated" => array( "operator" => "within",
"searchValue" => "".$date."T00:00:00.000-07:00",
"searchValue2" => "".$date2."T00:00:00.000-07:00" )));
$myNSclient->setSearchPreferences(false, 1000);
$searchResponse = $myNSclient->search($itemSearch);
$js = json_encode($searchResponse);
$file_name = "tmp/$date";
file_put_contents($file_name,$js);
}
Any ideas?