Articles in this section

Review request and response errors in NetSuite

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
    •  

Flow steps

The request and response errors integrator.io displays are determined by the flow steps (import, export, etc.).

Export errors

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:

  1. Handled/Intended errors - the export process (i.e. validation errors/valid saved search id) or the execution of savedSearch or a permissions-related error.
  2. Unhandled/Uncaught/Not in control - infrastructure-related errors (i.e network-timeouts, NetSuite downtime, or NON HTTP 200 response use-case)
    1. Any fatal errors leading to a search failure during export are denoted by a fatal node in the RESTlet response.

Export examples

The following table displays an example of the request sent and the response that returns 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.

Request Response
Shows:
  • The NetSuite search query
  • The search-related nlapis executed
  • The available search results until the point of failure.
Example:
var s = nlapiLoadSearch(‘item’, xxx) s.setFilterExpression([['isinactive', 'is', 'F'], 'AND', ['subsidiary', 'anyof', ‘4’], 'AND', ['itemid', 'contains', ‘Amazon’]) s.runSearch() s.getResults()
Shows the NetSuite nlapi response.
Example:
{ "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 table displays an example of the request sent and response that returns when NetSuite fails to process the request from integrator.io because of permission settings errors (not search or export errors).

Request Response
Shows:
  • 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}

Sample response:
Example 1
{ code: 'INVALID_ROLE', message: 'Your role does not give you permission to view this page.' }
Example 2
{ "code": "JS_EXCEPTION", "message":
"INSUFFICIENT_PERMISSION: Permission Violation: You need the 'Transactions -> Sales Order'
permission to access this page. Please contact your account administrator." }

Example 3
{ "code": "SSS_INSTRUCTION_COUNT_EXCEEDED", "message": "Script Execution Instruction Count Exceeded." }

Import errors

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:

  1. 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.)
  2. Unhandled/Uncaught/Not in control - infrastructure-related errors (i.e network-timeouts, NetSuite downtime, or NON HTTP 200 response use-case)
    1. Any fatal errors leading to a search failure during export are denoted by a fatal node in the RESTlet response.

Import examples

The following table displays an example of the request sent and the response returned when NetSuite fails during a lookup or mapping.

Request Response
Shows:
  • 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.

Sample request:
Example 1
{ fieldMapping : “record type: subsidiary mapped to field: subsidiary generated filter expression ["internalid","is","3566003566"] Lookup filter expression [\"internalid\",\"is\",\"{{{id}}}{{{id}}}\"]\r”, nlapi : var s = nlapiCreateSearch( "subsidiary",["internalid","is",3566003566],[ new nlobjSearchColumn(internalid)] ) var rs = s.runSearch().getResults(0, 10) rs.length: 4 JSON.stringify(rs) : [{}, {}, {}, {}] “}
Example 2
{ fieldMapping : “ "Lookup Name SubsidiaryLookupDynamic", "Lookup key clothing3566", "Mapped from Field {{[Category Id]}}{{id}}", "Mapped to Field subsidiary" ” }
Shows:
  • The actual error that occurs in NetSuite during the execution.
  • The custom error formed by the Mapper.

Sample request:
Example 1
{ "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\"." }
Example 2
{ "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

Request Response
Shows:
  • 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);
Shows:
  • NetSuite nlapi response.
  • The error/exception thrown by NetSuite without the stack trace.

Example
{ "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.

Request Response
Shows:
  • The raw HTTP request body we send to NetSuite.
The HTTP requests and responses are stored against every import object error.
Example
{ "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" } ] }
Show:
  • The error or errors in response received by the adaptor.
Example 1
{ code: 'INVALID_ROLE', message: 'Your role does not give you permission to view this page.' }
Example 2
{ "code": "JS_EXCEPTION", "message": "INSUFFICIENT_PERMISSION: Permission Violation: You need the 'Transactions -> Sales Order' permission to access this page. Please contact your account administrator." }
Example 3
{ "code": "SSS_INSTRUCTION_COUNT_EXCEEDED", "message": "Script Execution Instruction Count Exceeded." }
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.