You can view request and response errors from NetSuite and the Celigo NetSuite framework to debug errors if your account is on EM 2.0. integrator.io only supports NetSuite integrations that use the following protocols:
-
RESTlet 1.0
-
RESTlet 2.0/SDF
The request and response errors integrator.io displays are determined by the flow steps (import, export, etc.).
Use the Actions menu to view the request and response for any export or (dynamic) lookup that returns an error. The details displayed will vary depending on where the export or lookup failed.
Export errors have two classification types:
-
Handled/Intended errors - the export process (i.e. validation errors/valid saved search id) or the execution of savedSearch or a permissions-related error.
-
Unhandled/Uncaught/Not in control - infrastructure-related errors (i.e network-timeouts, NetSuite downtime, or NON HTTP 200 response use-case)
-
Any fatal errors leading to a search failure during export are denoted by a fatal node in the RESTlet response.
-
There are two export examples listed here:
The following is an example of the request sent and the response returned when NetSuite fails during the execution of a saved search. In this example, NetSuite received the request, but returned an error during the processing and execution of the saved search.
The error request shows:
-
The NetSuite search query
-
The search-related nlapis executed
-
The available search results until the point of failure
var s = nlapiLoadSearch(‘item’, xxx) s.setFilterExpression([['isinactive', 'is', 'F'], 'AND', ['subsidiary', 'anyof', ‘4’], 'AND', ['itemid', 'contains', ‘Amazon’]) s.runSearch() s.getResults()
The NetSuite nlapi responses:
{
"code": "INVALID_SEARCH",
"details": "That search or mass update does not exist."
}
{
"code": "insufficient_permission",
"message": "Failed to run saved search because Permission Violation: You need the 'Lists -> Items' permission to access this page. Please contact your account administrator."
}
The following is an example of the request sent and response returned when NetSuite fails to process the request from integrator.io because of permission settings errors (not search or export errors).
The error request shows the raw HTTP request body sent to NetSuite.
{
"method": "POST",
"uri": "https://tstdrv123456.restlets. api.netsuite.com/app/site/hosting/ restlet.nl",
"qs": {
"script": "customscript_celigo_rt_import_rest",
"deploy": "customdeploy_celigo_rt_import_deploy"
},
"headers": {
"Content-Type": "application/json",
"Authorization": "********"
},
"json": {
"flowId": "*************************",
"_exportId": "*************************",
"debugMode": true,
"_connectionId": "*************************",
"_flowId": "*************************",
"_integrationId": "*************************",
"integrator": true,
"pageSize": 1000,
"skipGrouping": true,
"recordType": "item",
"searchId": "78945"
},
"maxResponseBytes": 26214400,
"timeout": 900000
}
Error responses:
{
"code": "'INVALID_ROLE', message: 'Your role does not give you permission to view this page.'"
}
{
"code": "JS_EXCEPTION",
"message": "INSUFFICIENT_PERMISSION: Permission Violation: You need the 'Transactions -> Sales Order' permission to access this page. Please contact your account administrator."
}
{
"code": "SSS_INSTRUCTION_COUNT_EXCEEDED",
"message": "Script Execution Instruction Count Exceeded."
}
Use the Actions menu to view the request and response for any import request that results in an error. The error details will vary depending on where the import failed.
Import errors have two classification types:
-
Handled/Intended errors - One or more are returned for each imported record in the request (i.e. import processes like mapping lookup failures, record save errors, record initialization errors.)
-
Unhandled/Uncaught/Not in control - infrastructure-related errors (i.e network-timeouts, NetSuite downtime, or NON HTTP 200 response use-case)
-
Any fatal errors leading to a search failure during export are denoted by a fatal node in the RESTlet response.
-
There are three import examples here:
The following is an example of the request sent and the response returned when NetSuite fails during a lookup or mapping.
The error requests show:
-
Mapping related details:
-
Extract or generate fields.
-
-
The NetSuite search query.
-
The search-related nlapis executed.
-
The available search results until the point of failure.
-
Details of HANDLEBARS/STATIC_lookup failures.
var s = nlapiLoadSearch('item', xxx) s.setFilterExpression([
['isinactive', 'is', 'F'], 'AND', ['subsidiary', 'anyof', ‘4’], 'AND', ['itemid', 'contains', ‘Amazon’]
]) s.runSearch() s.getResults()
{
fieldMapping: “ "Lookup Name SubsidiaryLookupDynamic",
"Lookup key clothing3566",
"Mapped from Field {{[Category Id]}}{{id}}",
"Mapped to Field subsidiary"”
}
The error responses show:
-
The actual error that occurs in NetSuite during the execution.
-
The custom error formed by the Mapper.
{
"source": "mapping",
"code": "VALUE_LOOKUP_FAILED",
"message": "A mapping error occurred. Could not find a match for \"[\"name\",\"is\",\"38\"]\" for the record type \"Subsidiary\"."
}
{
"source": "mapping",
"code": "MISSING_STATIC_LOOKUP",
"message": "Could not find mapping in static lookup. { Source: sub} { Key: 38}"
}
The following table displays an example of the request sent and the response returned when NetSuite fails while processing nlapi requests submitted by the Celigo NS framework.
-
The final object for initialization ($R input)
-
Executed nlapis
Importing record 0-- - {}
var r = nlapiCreateRecord("customer", {});
r.setFieldValue("isperson", "T");
r.setFieldValue("firstname", "Prasu");
r.setFieldValue("lastname", "Kavali");
r.setFieldValue("phone", null);
r.setFieldValue("mobilephone", null);
r.setFieldValue("email", "prasu@gmail.com");
r.setFieldValue("companyname", "Celigo");
r.selectNewLineItem("addressbook");
sr = r.editCurrentLineItemSubrecord("addressbook", "addressbookaddress");
sr = r.createCurrentLineItemSubrecord("addressbook", "addressbookaddress");
sr.commit();
r.commitLineItem("addressbook");
nlapiSubmitRecord(r, false, false);
The error response shows:
-
NetSuite nlapi response.
-
The error/exception thrown by NetSuite without the stack trace.
{
"code": "USER_ERROR",
"details": "Please enter value(s) for: First Name, Last Name, Subsidiary",
"name": "USER_ERROR",
"message": "Please enter value(s) for: First Name, Last Name, Subsidiary",
"description": "Please enter value(s) for: First Name, Last Name, Subsidiary"
}
The following table displays an example of the request sent and the response returned when NetSuite fails to respond to integrator.io.
The error request shows the raw HTTP request body we send to NetSuite.
Note
The HTTP requests and responses are stored against every import object error.
{
"flowId": "•••••••••",
"_importId": "•••••••",
"settings": {
"import": {},
"integration": {
"kvSetting1ForIntegration": [],
"txtSetting2ForIntegration": "12",
"import_da": {},
"_connectionId": "••••••••",
"_flowId": "••••••••",
"_integrationId": "••••••",
"debugMode": true,
"data": [
{
"id": "38",
"Internal Id": "38",
"SKU": "PRI00002",
"Quantity": "19"
}
]
}
}
}
This shows the error response(s) received by the adaptor.
{
"code": "INVALID_ROLE",
"message": "Your role does not give you permission to view this page."
}
{
"code": "JS_EXCEPTION",
"message": "INSUFFICIENT_PERMISSION: Permission Violation: You need the 'Transactions -> Sales Order' permission to access this page. Please contact your account administrator."
}
{
"code": "SSS_INSTRUCTION_COUNT_EXCEEDED",
"message": "Script Execution Instruction Count Exceeded."
}