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();
}
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
从客户端脚本调用restlet时,使用客户端脚本获取记录ID并发送记录ID,可以使用id.getfieldvalue。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.