Hey,
So I'm trying to display a custom field (custrecord...) via the PHP Toolkit. It's the latest version. I copied this from SuiteAnswers and it works absolutely fine.
<?php
require_once './PHPToolkit/NetSuiteService.php';
$service = new NetSuiteService();
$request = new GetRequest();
$request->baseRef = new CustomRecordRef();
$request->baseRef->internalId = "58";
$request->baseRef->typeId = "122"; // Internal id of the Custom Record Type
$getResponse = $service->get($request);
if (!$getResponse->readResponse->status->isSuccess) {
echo "GET ERROR";
} else {
$custrec = $getResponse->readResponse->record;
echo "GET SUCCESS! <br />";
echo "Record Name: ". $custrec->name . " <br />";
echo "Internal Id: ". $custrec->internalId . " <br />";
}
?>
The result is on my webpage:
GET SUCCESS!
Record Name: GVSM58
Internal Id: 58
This is perfect, the results are right. Now I want to display a custom field value on the page, e.g. custrecord100, which has the field value of "Donkey". No matter what I do, it just won't show. I've looked at the suiteanswer guides and tried to replicate what they have there, but I cannot get it to show. It would be so much simpler if it was just $custrec->custrecord100!
Can someone tell me what the correct way of getting the field value is!
Much appreciated.