Discussions
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
InternalID cannot be converted
Hi,
Need help, I'm trying to get the internalID of records from a saved search using PHP.
But this error appear.
Object of class RecordRef could not be converted to string
Below is my code.
include_once 'NetSuiteService.php';
$service = new NetSuiteService();
$search = new TransactionSearchAdvanced();
$search->savedSearchId = "586"; //Search internal ID
$request = new SearchRequest();
$request->searchRecord = $search;
$searchResponse = $service->search($request);
//print_r($searchResponse);
var_dump($searchResponse);
$rec = count($searchResponse->searchResult->totalRecords);
$record = $searchResponse->searchResult->searchRowList->searchRow;
echo "<br>";
if($rec > 0){
foreach ($record as $records) {
echo "InternaldID:" . $records->basic->internalId[0]->searchValue ."<br>";