Debugging Saved Search Jobs¶
Because so many configuration parameters are involved, both within NetSuite and within Mitto, it is sometimes difficult to pin down the cause of saved search jobs that aren’t working as expected.
One technique is to eliminate Mitto from the picture and execute the saved search via Mitto’s Saved Search RESTlet directly from the browser. This is helpful in that it can identify user/permission problems and it displays the data returned by the NetSuite saved search verbatim in the browser.
These instructions use FireFox, though Chrome can be used in a similar manner.
Get the internal id of the saved search you wish to use. This example uses a saved search for
Customer
records with an internal id ofcustomsearch801
.In the browser, navigate to the deployment record for the Mitto Saved Search RESTlet.
Customization -> Scripting -> Script Deployments
. Clickview
on the Mitto Saved Search RESTlet.Click the URL.
Script Deployment Record¶
A new window will open and an error message will be displayed.
Error Message¶
In the window with the error, open the developer tools inspector:
Right-click -> Inspect
.In the Inspector portion of the window, click
Network
.In the Network Inspector, click
Reload
.Network Inspector¶
The same error will appear again. Scroll to the top of the network traffic. The first row will have a status of
500
. This represents the GET that was issued whenReload
was clicked.We will modify this request and resend it. The response will contain the first block of data from our saved search.
Right-click on the first row and click
Edit and Resend
In the
Method
box, replaceGET
withPOST
.Scroll to the bottom of
Request Headers
and add a new line:Content-Type: application/json
Click in the
Request Body
section and add the following JSON content:{ "record_type": "Customer", "search_id": "customsearch801", "last_modified_column": "None", "internal_id": "1", "line_id": "None", "batch_size": "1000", "log_level": "DEBUG" }
The contents of the Request Body is passed to the Mitto Saved Search RESTlet. The values control the RESTlet’s behavior.
record_type
andsearch_id
must match the saved search that is to be used.The remaining key/value pairs are likely to be of limited use for debugging purposes; their functions are described the the job configuration documentation.
Your request should look like the one below.
Edit and Resend¶
Click
Send
. A new line will appear at the bottom of the Network Inspector. I should have a status of200
and aMethod
ofPOST
.Click the new line. In the section of the Inspector that opens on the right, click
Response
.Response¶
The response containing JSON objects from the Mitto Saved Search will be displayed. The objects can be expanded to view their content.