Paul Gregson
Paul Gregson

Reputation: 166

Netsuite: How do I track down which scripts are running?

We have an error. Any time someone goes to a Credit Card Sale record and clicks the print icon they get an error that says "An unexpected error has occurred. Please click here to notify support and provide your contact information." I am assuming that behind the scenes a custom script someone else has written is failing. How can I track this down to fix it?

Upvotes: 2

Views: 5068

Answers (4)

bknights
bknights

Reputation: 15367

Depending on how many scripts you have active in your Netsuite account you may want to first have a look at the script logs.

  1. go to Lists-> Search -> Saved Searches -> New
  2. find "Server Script Log"
  3. set Criteria to Type = System and filter to a date that includes when you saw the error
  4. add a result scroll down to Script Fields ... and add Name
  5. Script Type should have been on the results by default but if not add that too
  6. run the search. If the error was thrown by a custom script it should be in this list.

If your error is not there then try changing the form you are printing with. If that fixes the issue then it may be you have something on the form that NS can't handle. NS throws "unexpected error" for all sorts of things it should be able to report more about.

Upvotes: 3

prasun
prasun

Reputation: 7343

Printing transactions related error happens due to "Advanced PDF/HTML Templates" errors as well.

You can edit current record and then you would see customise link at top-right , clicking which you would see customise form. Upon customising form you would see Print Template select option and Printing Type radio.

If radio is set to advanced you would find template at To view templates go to customisations > forms > Advanced PDF/HTML Templates

if radio is set to basic you would find template at customisations > forms > Transaction form PDF layouts

Advanced templates involves fair amount of scripting and HTML/CSS tags which are likely to hold a programmer bug.

If advanced template is being used then I advise you to switch to a standard template over custom template, if that also gives error switch to a standard transaction form by moving to basic from advanced, which will help you to diagnose the culprit component.

Upvotes: 0

Rockstar
Rockstar

Reputation: 2288

In addition, what you can do with a minimum change to identify the script and error details is, simply go to the deployed scripts and put your mail in to NOTIFY EMAILS. It will trigger you the script name along with the error in case it is any system generated error.

enter image description here

Upvotes: 1

Rusty Shackles
Rusty Shackles

Reputation: 2840

You can start by looking at the scripts deployed in the record. You can do this by going to Customizations > Scripting > Scripted Records.

I would recommend that you undeploy all the scripts and inactivate all workflows for the record.

Then check if the error occurs, if not deploy 1 script then try again. I would deploy scripts in this order

  1. Client Side
  2. User Event
  3. Workflows.

I know its tedious but as far as I know, there is no other way to easily track which script is causing the unexpected error.

Another option you can take is to do a Script Log search. I believe Unexpected Errors for script are added to the script regardless of the log level.

Upvotes: 2

Related Questions