Hi,
We built a Netsuite integration into our solution, and at some point, we need to fetch Invoice PDFs from our customers.
We are using a Restlet installed into our customer' Netsuite instance using a SuiteApp we developed.
Unfortunately, for one of our customers, we are getting an error "An unexpected SuiteScript error has occurred".
{"type":"error.SuiteScriptError","name":"UNEXPECTED_ERROR","message":"An unexpected SuiteScript error has occurred","id":"xxx","stack":["Error
at Object.get (/SuiteApps/com.xxx.xxx/pdf.js:21:23)"],"cause":{"type":"internal error","code":"UNEXPECTED_ERROR","details":"An unexpected SuiteScript error has occurred","userEvent":null,"stackTrace":["Error
at Object.get (/SuiteApps/com.xxx.xxx/pdf.js:21:23)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
Restlet code:
/**
* @NApiVersion 2.1
* @NScriptType Restlet
* @NModuleScope SameAccount
*/
define(["N/render"], main);
/**
* @param{record} render
*/
function main(render) {
/**
* Defines the function that is executed when a GET request is sent to a RESTlet.
* @param {Object} requestParams - Parameters from HTTP request URL; parameters passed as an Object (for all supported
* content types)
* @returns {string | Object} HTTP response body; returns a string when request Content-Type is 'text/plain'; returns an
* Object when request Content-Type is 'application/json' or 'application/xml'
* @since 2015.2
*/
function get(requestParams) {
var file = render.transaction({
entityId: +requestParams.transactionId,
printMode: render.PrintMode.PDF,
inCustLocale: true,
});
return {
data: file.getContents(),
};
}
return { get };
}
What are the possible reasons for this issue? How can we know the origin of this issue? What can we ask our customer to give us to find the origin of the issue?
Thanks in advance for your reply,
Thomas