I was able to make the api work in php and search customer by internal id. However i have a scenario, where i'll be searching a customer by a custom field. Under Customer and it has a custom tab contains multiple domain name and domain details.
For example :
Main search criteria : Domain Name
How is this possible in netsuite php api? Much appreciated for any help. im only newbie to NetSuite. How will i modify this sample code to search by custom field?
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new RecordRef();
$request->baseRef->internalId = "1780";
$request->baseRef->type = "customer";
$getResponse = $service->get($request);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
$customer = $getResponse->readResponse->record;
//var_dump($customer);
echo "GET SUCCESS, customer:";
echo "\nCompany name: ". $customer->companyName;
echo "\nInternal Id: ". $customer->internalId;
echo "\nEmail: ". $customer->email;
echo "\nCustomerID: ". $customer->firstName;
}
OK, I'm trying to get the custom record of all domains base from egrubaugh360.
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new CustomRecordRef();
$request->baseRef->internalId = "47";
//$request->baseRef->externalId = "xxxx";
$request->baseRef->typeId = "custom_list_domains";
$getResponse = $service->get($request);
var_dump($getResponse);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
var_dump($getResponse->readResponse->record);
echo "GET SUCCESS";
}
I'm not sure what to put in "typeId", what exactly is the type to put? It gives me error "Invalid custom record type key"
object(GetResponse)#8 (1) { ["readResponse"]=> object(ReadResponse)#9 (2) { ["status"]=> object(Status)#10 (2) { ["statusDetail"]=> array(1) { [0]=> object(StatusDetail)#11 (3) { ["code"]=> string(26) "INVALID_CSTM_RCRD_TYPE_KEY" ["message"]=> string(31) "Invalid custom record type key." ["type"]=> string(5) "ERROR" } } ["isSuccess"]=> bool(false) } ["record"]=> NULL } }