Reputation: 8952
I am trying to create a restlet in which i can get the detail of a Field in Netsuite.I have tried the following code to get the details.When i run this Restlet by calling the external URL i get an error as:
error code: UNEXPECTED_ERROR
error message:TypeError: Cannot call method "getType" of null (login.js$12762#16)
I am using following code
function getRESTlet(dataIn) {
var field = nlapiGetField('custitem_cipp'); // specifiy the internalId of the field
return field.getType();
}
Upvotes: 0
Views: 371
Reputation: 100
Use a client script to get the record id and send the record id while calling a restlet from client script, there use can use id.getfieldvalue.
Upvotes: 0
Reputation: 2840
Fields are only on the record, when your RESTlet executes, there is no record loaded. You need to load the item record then use nlobjRecord.getField
Upvotes: 0