Time: Reference | Level: Any level
You will learn: Fixes for the most common errors, plus answers to common questions.
You will need: The error text from your Execution Log or from Slack.
Something is not working? Do not worry, almost every problem falls into a short list. Work through this page from top to bottom.
First, the golden debugging routine
When a Slack alert does not show up, check these in order. Most problems are found in the first three.
- Did the script run at all? Go to Customization > Scripting > Script Deployments, open the deployment and look at the Execution Log subtab. No entries usually means the deployment is not applied to that record, its status is Testing and you are a different user, or the audience does not include your role.
- Did the script reach the Slack call? Add a temporary
log.debug('About to call Slack', payload)just beforehttps.post. If you never see it, an earlierreturn(like a threshold or a record type check) is stopping it. - What did Slack answer? Log both
response.codeandresponse.body. Slack’s answer usually names the problem. - Is the message going where you think? Check the channel and workspace. Test webhooks are a classic source of “it sent, but somewhere else”.
Error message cheat sheet
| What you see | What it usually means | What to do |
|---|---|---|
invalid_payload |
The JSON is broken or has a bad structure | Log the body, paste it into a JSON checker, and look for unescaped quotes or line breaks |
no_text |
The message has no text or blocks |
Send at least a text field |
channel_not_found |
Wrong channel name or ID, or the channel was archived | Use the channel ID, and for public channels make sure the app has chat:write.public |
not_in_channel |
The app cannot post to a private channel it has not joined | In Slack, invite the app to the channel (/invite @NetSuite Alerts) |
invalid_auth or not_authed |
Missing, wrong or revoked token | Check the Authorization: Bearer xoxb-... header and reinstall the app if needed |
missing_scope |
The token lacks a permission | Add the scope under OAuth & Permissions and reinstall the app |
no_service or HTTP 404/410 from a webhook |
The webhook was deleted or revoked | Create a new webhook and update NetSuite |
| HTTP 429 | You are sending too fast | Wait for Retry-After seconds and batch your messages |
invalid_blocks |
A block is malformed (for example too many fields or text too long) | Test the JSON in Block Kit Builder |
Remember that the Web API (chat.postMessage) often answers with HTTP 200 even when it fails, so always read ok and error in the response body.
NetSuite-side problems
“The script runs in the log but nothing appears in Slack.”
Look for the Slack response in the log. If you see ok or "ok": true the message was accepted, so check you are looking at the right channel and workspace. If you see an error, use the table above.
“SSS_MISSING_REQD_ARGUMENT” or “undefined” errors
Usually a script parameter is empty or its ID is spelled differently. Check the exact parameter ID, including the custscript prefix, and make sure a value is set on the deployment, not just on the script record.
“SSS_USAGE_LIMIT_EXCEEDED”
The script did too much in one run. Send fewer messages per run, or move the sending to a Scheduled or Map/Reduce script. See Best Practices.
“The alert fires twice.”
Common causes: two deployments on the same record type, an edit event as well as a create event, or a workflow or another script that saves the record again. Check the deployment list, and log context.type to see what fires.
“It works for me but not for other users.”
Deployments in Testing status only run for the person who deployed them. Also check the Audience roles and employees.
“It worked in the sandbox, not in production.”
Sandboxes and production have different domains, script IDs, parameters and record IDs. Check that you deployed to production, that parameters are filled in, and that your production webhook is correct. Also see whether the production account restricts outbound calls in any way your admin knows about.
“It stopped working after a sandbox refresh.”
Refreshes copy production data and scripts to the sandbox. Deployment statuses and parameters may need to be checked again, and secrets may need to be re-entered.
Slack-side problems
“The button or slash command says ‘operation_timeout’ or ‘failed’.”
Slack waits about three seconds for your Suitelet to answer. Check for slow searches, large record loads or extra HTTP calls. Reply first, and do slow work afterwards in another script.
“Signature verification always fails.”
Check, in order:
- You are using the signing secret from Basic Information, not the bot token.
- You are using the raw request body, exactly as received, not a re-encoded version.
- The string being signed is
v0:+ timestamp +:+ body. - The header names match. Log all headers once and see how NetSuite presents them.
- The clock is correct. A large time difference will trip the replay check.
- The secret was copied without extra spaces or line breaks.
“Slack says the Request URL is not verified or cannot be reached.”
- The Suitelet must be Available Without Login and you must use the External URL, not the internal one.
- The deployment must be Released.
- Make sure the script always returns a response, including for GET requests.
“The slash command shows ‘dispatch_failed’.”
Slack could not reach your URL at all. Re-check the Request URL, confirm the deployment is released, and try opening the external URL in a browser.
“Approve button worked but the message did not change.”
The response_url call failed or was made too late. Check the log for the response from that POST and make sure you are sending valid JSON.
“I cannot see the app in a private channel.”
Invite it: type /invite @YourAppName in that channel.
Frequently asked questions
Is there an official NetSuite and Slack connector?
There are a number of options: your own SuiteScript, iPaaS tools such as Celigo or Workato, no-code tools such as Zapier, and middleware you may already own, such as Boomi. Check what is currently available in the SuiteApp marketplace for anything that fits, and compare it with the effort of a small script. See Ways to Connect NetSuite and Slack.
Can I do this without writing code?
For simple one-way alerts, yes, with a no-code tool. Interactive features like approvals and slash commands are much easier with SuiteScript.
Can a NetSuite Workflow post to Slack directly?
Workflows cannot make arbitrary web calls on their own. A common approach is to add a Workflow Action Script that makes the Slack call, so admins can still design the process visually.
Will Slack alerts slow down NetSuite?
Not noticeably, if you use afterSubmit, keep to one call per save, and handle errors. Do not call Slack from client scripts or beforeSubmit.
Should I use webhooks or the bot token?
Start with webhooks for simple channel alerts. Use the bot token when you need direct messages, buttons, slash commands, thread replies or message updates.
Can I message individual people?
Yes, with a bot token. Match the NetSuite employee’s email to the Slack user (using users.lookupByEmail or users.info, which need the users:read.email scope), then post to that user.
Is it secure?
It can be, if you follow the basics: keep secrets out of scripts, verify Slack signatures, validate who is allowed to do what, limit the data you send and restrict the Suitelet to narrow actions. Read the secrets page and the cautions on the approvals page.
Can I use this for customers or vendors outside my company?
Slack Connect can share channels with other organisations, but be very careful about what NetSuite data you post there. In most cases, keep these alerts internal.
How do I stop a runaway alert?
Set the script deployment to Not Scheduled or Testing, or untick the enabled parameter if you built one. Then delete or revoke the webhook if you need an immediate hard stop.
How much does it cost?
Slack’s API calls from your own scripts have no per-message fee, but your Slack plan and NetSuite licence terms still apply, and no-code or iPaaS tools have their own pricing. Check current plan details with each vendor.
Still stuck?
Ask on the Q&A section of this site. Include:
- What you expected to happen and what happened instead.
- The relevant part of the Execution Log (with secrets removed).
- The script type and the record it is deployed on.
- The exact Slack error text, if any.
The more precise the question, the faster the answer.
Back to the series overview.