i'm trying retrieve available options shipping method sales order form encountered unexpected error in using getselectoptions.
function get_select_options(datain) { var rec = nlapicreaterecord(datain.recordtype); var field = rec.getfield(datain.field); var options = field.getselectoptions(); return options; }
and here's code calling script.
$url = "https://rest.sandbox.netsuite.com/app/site/hosting/restlet.nl"; $client = new client(); $authorization = [ 'nlauth nlauth_account='.getenv('netsuite_account'), 'nlauth_email='.getenv('netsuite_email'), 'nlauth_signature='.getenv('netsuite_password'), 'nlauth_role='.getenv('netsuite_role') ]; $response = $client->request('get', $url, 'headers' => [ 'authorization' => implode(',', $authorization), 'content-type' => 'application/json' ], 'query' => [ 'script' => '343', 'deploy' => '1', 'recordtype' => 'salesorder', 'field' => 'shipmethod' ] ]); return json_decode($response->getbody());
my record type , field seems correct have read in docs. followed of example codes uses getselectoptions, can't move on because of unexpected/unknown error. tried return record (rec) make sure php code working.
guzzlehttp\exception\serverexception message 'server error: `get https://rest.sandbox.netsuite.com/app/site/hosting/restlet.nl?script=343&deploy=1&recordtype=salesorder&field=shipmethod` resulted in `500 internal server error` response: {"error" : {"code" : "unexpected_error", "message" : "an unexpected error has occurred. error id: irc3j6d915k2asvrqbfhb" (truncated...) '
Comments
Post a Comment