Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The NetSuite Pro

The NetSuite Pro Logo The NetSuite Pro Logo

The NetSuite Pro Navigation

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us
Home/ NetSuite + Slack Integration: The Complete Step-by-Step Guide/Send a Daily NetSuite Digest to Slack with a Scheduled Script

Send a Daily NetSuite Digest to Slack with a Scheduled Script

Part 9 of 13 in the NetSuite + Slack series
Time: 30 minutes  |  Level: Some SuiteScript helps
You will learn: How to post a short morning summary to Slack on a schedule.
You will need: A sandbox and a webhook for the channel that should get the digest.

Alerts tell you when something happens. A digest tells you where things stand. A short summary posted every morning gives the whole team the same picture before the day starts. It also replaces the “does anyone know how many orders are still open?” question.

What we are building

A message like this, posted to #finance-daily at 7:30 every weekday morning:

Good morning! Your NetSuite snapshot
Overdue invoices: 14 totalling $38,420.00
Sales orders waiting for approval: 6
Open purchase orders past their due date: 3

How it works

  1. A Scheduled Script runs at the time you choose.
  2. It runs a few searches and adds up the results.
  3. It builds a message and posts it to a Slack webhook.

The script

/**
 * @NApiVersion 2.1
 * @NScriptType ScheduledScript
 *
 * Posts a daily NetSuite snapshot to Slack.
 */
define(['N/search', 'N/https', 'N/runtime', 'N/log'],
  (search, https, runtime, log) => {

    // Count and total overdue invoices.
    const overdueInvoices = () => {
      const s = search.create({
        type: search.Type.INVOICE,
        filters: [
          ['mainline', 'is', 'T'], 'AND',
          ['status', 'anyof', 'CustInvc:A'], 'AND',   // Open
          ['duedate', 'before', 'today']
        ],
        columns: [
          search.createColumn({ name: 'internalid', summary: search.Summary.COUNT }),
          search.createColumn({ name: 'amountremaining', summary: search.Summary.SUM })
        ]
      });
      const row = s.run().getRange({ start: 0, end: 1 })[0];
      return {
        count: Number(row.getValue({ name: 'internalid', summary: search.Summary.COUNT })) || 0,
        total: Number(row.getValue({ name: 'amountremaining', summary: search.Summary.SUM })) || 0
      };
    };

    // Count sales orders that are pending approval.
    const ordersPendingApproval = () => {
      const s = search.create({
        type: search.Type.SALES_ORDER,
        filters: [
          ['mainline', 'is', 'T'], 'AND',
          ['status', 'anyof', 'SalesOrd:A']            // Pending Approval
        ],
        columns: [ search.createColumn({ name: 'internalid', summary: search.Summary.COUNT }) ]
      });
      const row = s.run().getRange({ start: 0, end: 1 })[0];
      return Number(row.getValue({ name: 'internalid', summary: search.Summary.COUNT })) || 0;
    };

    const execute = () => {
      try {
        const webhookUrl = runtime.getCurrentScript().getParameter({ name: 'custscript_slack_digest_webhook' });
        if (!webhookUrl) { log.error('Digest skipped', 'No webhook URL set'); return; }

        const inv    = overdueInvoices();
        const orders = ordersPendingApproval();

        const money = (n) => '$' + n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });

        const payload = {
          text: 'Your NetSuite snapshot',
          blocks: [
            { type: 'header', text: { type: 'plain_text', text: 'Good morning! Your NetSuite snapshot' } },
            {
              type: 'section',
              fields: [
                { type: 'mrkdwn', text: '*Overdue invoices*\n' + inv.count + ' totalling ' + money(inv.total) },
                { type: 'mrkdwn', text: '*Orders waiting for approval*\n' + orders }
              ]
            },
            { type: 'context', elements: [ { type: 'mrkdwn', text: 'Posted automatically by NetSuite' } ] }
          ]
        };

        const res = https.post({
          url: webhookUrl,
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify(payload)
        });

        if (res.code !== 200) log.error('Digest failed', res.code + ' ' + res.body);
      } catch (e) {
        log.error('Digest error', e.name + ': ' + e.message);
      }
    };

    return { execute };
  });

The status codes CustInvc:A (open invoice) and SalesOrd:A (pending approval) are standard search values. Account settings such as approval routing can change which statuses apply, so confirm them in a saved search in your own account first.

Deploy and schedule it

  1. Upload the file and create a Scheduled Script record.
  2. Add a script parameter custscript_slack_digest_webhook (Free-Form Text) for the webhook URL.
  3. Create a deployment. On the Schedule subtab, choose Single Event or Daily Event, set the start time (for example 7:30 AM), and repeat every day.
  4. To skip weekends, choose Weekly and tick Monday to Friday.
  5. Set Status to Scheduled for it to run automatically (or Not Scheduled if you want to run it manually while testing).
  6. Use Save & Execute to run it once immediately and check Slack.

Schedules run in the time zone set for the deployment or account, so double-check the time you actually get.

Tips for a good digest

  • Keep it short. Three to six numbers is plenty. People stop reading long digests.
  • Show what needs action, not everything. “6 orders waiting for approval” is useful; “1,842 total orders” is not.
  • Add links. A button that opens the matching saved search turns a number into a next step.
  • Highlight problems. You might add a red circle emoji when overdue amounts pass a threshold.
  • Use several digests for several audiences. Finance, warehouse and sales each want different numbers in their own channels.

Bigger volumes

Searches with thousands of rows need more care than a summary search. For long lists, use a saved search with runPaged or a Map/Reduce script, and post only the top ten with a link to the full list.

What is next

You now have alerts, approvals, lookups and digests. Let us zoom out for a list of practical ways Slack streamlines NetSuite processes.


← Look Up NetSuite Records With a Slack Slash Command
Series overview
12 Practical Ways Slack Streamlines NetSuite Processes →
Share
  • Facebook

Sidebar

Ask A Question

Stats

  • Questions 6
  • Answers 6
  • Best Answers 0
  • Users 9
  • Popular
  • Answers
  • Rocky

    Issue in running a client script in NetSuite SuiteScript 2.0 ...

    • 1 Answer
  • admin

    How can I send an email with an attachment in ...

    • 1 Answer
  • admin

    How do I avoid SSS_USAGE_LIMIT_EXCEEDED in a Map/Reduce script?

    • 1 Answer
  • admin
    admin added an answer The issue is usually caused by following Wrong script file… September 14, 2025 at 10:33 pm
  • admin
    admin added an answer Steps to send an Invoice PDF by email: define(['N/email', 'N/render',… August 28, 2025 at 3:05 am
  • admin
    admin added an answer This error means your script hit NetSuite’s governance usage limit… August 28, 2025 at 3:02 am

Top Members

Rocky

Rocky

  • 1 Question
  • 22 Points
Begginer
74gold

74gold

  • 0 Questions
  • 20 Points
Begginer
Sophie1022

Sophie1022

  • 0 Questions
  • 20 Points
Begginer

Trending Tags

clientscript netsuite scripting suitescript
  • The SuiteScript 1.0 scripts nobody remembers: Portlets, Mass Updates and Workflow ActionsSeptember 10, 2026
  • You’re on SuiteScript 2.0, not 1.0. Here’s what that actually buys you.September 9, 2026
  • Converting a SuiteScript 1.0 Suitelet to 2.1 (and the ones that were never really forms)September 8, 2026
  • Every NetSuite certification in 2026, and the rules that quietly changedSeptember 7, 2026
  • Converting a SuiteScript 1.0 Scheduled Script to a 2.1 Map/Reduce (and why a straight port is a mistake)September 7, 2026
  • Migrating a SuiteScript 1.0 RESTlet to SS2.1 + OAuth 2.0 before the 2027.1 deadlineAugust 15, 2026
  • How to convert a SuiteScript 1.0 User Event script to SuiteScript 2.1 (with real code)August 14, 2026
  • The complete SuiteScript 1.0 to 2.1 API cheat sheet: nlapiXxx β†’ N/moduleAugust 13, 2026
  • NetSuite Error Messages: Causes and FixesAugust 11, 2026
  • How to audit every SuiteScript 1.0 script in your NetSuite account (step by step)August 11, 2026

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Menu

  • Home
  • About Us
  • Tutorials
    • NetSuite Scripting
    • NetSuite Customization
    • NetSuite Integration
    • NetSuite Advanced PDF Templates
    • NetSuite Reporting & Analytics Guide
    • Real-World NetSuite Examples
  • Blog
  • Contact Us

Quick Links

  • NetSuite Scripting
  • NetSuite Customization
  • NetSuite Advanced PDF Template
  • NetSuite Integration
  • NetSuite Reporting & Analytics

Subscribe for NetSuite Insights....

Β© 2026 The NetSuite Pro. All Rights Reserved