๐งฉ Integration Logging & Monitoring Dashboard in NetSuite
Introduction
Integrations are the heartbeat of a connected ERP ecosystem โ connecting NetSuite with Shopify, Salesforce, 3PLs, or internal systems.
But when data fails or records go missing, you need visibility โ and thatโs where a custom logging and monitoring dashboard comes in.
This tutorial will show you how to build a fully auditable, real-time integration log using custom records, saved searches, and SuiteAnalytics workbooks.
Youโll also learn to capture API errors, record payloads, and set up alerts โ so you can monitor and debug integrations directly within NetSuite.
๐ก Why Create a Logging Dashboard?
Benefit | Description |
---|---|
Central Visibility | View all incoming/outgoing integrations from one page |
Audit Trail | Track each API call with timestamps and status |
Error Management | Identify failed calls and retry them |
Performance Metrics | Analyze latency, response time, and frequency |
Compliance | Maintain integration records for audit or IT governance |
๐งฑ Step 1: Create Custom Record for Logging
Name: Integration Log
ID: customrecord_integration_log
Field Label | ID | Type | Description |
---|---|---|---|
Integration Source | custrecord_integration_source | List/Text | e.g., Boomi, Celigo, RESTlet |
Record Type | custrecord_record_type | List/Text | e.g., Sales Order, Customer |
External ID | custrecord_external_id | Text | Source system record ID |
Request Payload | custrecord_request_payload | Long Text | JSON/XML request |
Response Message | custrecord_response_msg | Long Text | API response |
Status | custrecord_status | List (Success, Failed, Warning) | Status of transaction |
Timestamp | custrecord_timestamp | Date/Time | Auto-generated |
Duration (ms) | custrecord_duration | Integer | API response time |
Retry Count | custrecord_retry_count | Integer | Optional tracking |
โ
Permissions:
Grant โFullโ access to Integrations Admin / Developer roles only.
โ๏ธ Step 2: Log Data via RESTlet or Script
Example RESTlet to log integration results:
/**
* @NApiVersion 2.1
* @NScriptType Restlet
*/
define(['N/record', 'N/log', 'N/runtime'], (record, log, runtime) => {
const post = (request) => {
const start = new Date();
let status = 'Success', message = '', nsRecordId = null;
try {
// Sample: Create a Customer
const rec = record.create({ type: 'customer' });
rec.setValue('companyname', request.companyname);
nsRecordId = rec.save();
message = 'Record created successfully';
} catch (e) {
status = 'Failed';
message = e.message;
}
// Log integration details
record.create({ type: 'customrecord_integration_log', isDynamic: true })
.setValue('custrecord_integration_source', 'Boomi')
.setValue('custrecord_record_type', 'Customer')
.setValue('custrecord_external_id', request.externalId || '')
.setValue('custrecord_request_payload', JSON.stringify(request))
.setValue('custrecord_response_msg', message)
.setValue('custrecord_status', status)
.setValue('custrecord_timestamp', new Date())
.setValue('custrecord_duration', new Date() - start)
.save();
return { status, message, nsRecordId };
};
return { post };
});
โ
Result:
Every API call is logged with payload, result, and performance data โ all visible in NetSuite.
๐งฎ Step 3: Create Saved Search for Monitoring
Saved Search: Integration Log โ Daily Summary
Column | Formula / Field | Purpose |
---|---|---|
Source | custrecord_integration_source | Identify integration type |
Success Count | COUNT(CASE WHEN {custrecord_status}='Success' THEN 1 END) | Daily success |
Failure Count | COUNT(CASE WHEN {custrecord_status}='Failed' THEN 1 END) | Daily errors |
Average Duration | AVG({custrecord_duration}) | Performance indicator |
Last Run Time | MAX({custrecord_timestamp}) | Latest call |
Filter: custrecord_timestamp within this week
Add Highlighting Rules:
- Red for
Failed
- Yellow for
Warning
- Green for
Success
๐ Step 4: Build a SuiteAnalytics Workbook Dashboard
Create Workbook โ Base Dataset: Integration Log
Recommended Views:
- Chart 1: Success vs Failed (Bar Chart by Source)
- Chart 2: Average API Duration (Line Graph by Date)
- Pivot Table: Count of integrations per Record Type and Source
๐ก Bonus Tip: Add this workbook to the Home Dashboard as a portlet for real-time visibility.
๐ Step 5: Add Auto-Alert Notifications
Option 1 โ Workflow Alert
Create a Workflow on the Integration Log record:
- Trigger: On Create
- Condition:
Status = Failed
- Action: Send Email to Developer/Admin
- Subject: โIntegration Error โ ${custrecord_integration_source}โ
Option 2 โ Scheduled Script Summary
Run daily summary report and email it to your Integration Team:
email.send({
author: 1234,
recipients: ['integration@company.com'],
subject: 'Daily Integration Summary',
body: 'Todayโs failed transactions: 3\nPlease review the Integration Log in NetSuite.'
});
๐ง Step 6: Real-World Dashboards
Dashboard Type | Example Metrics |
---|---|
Boomi Integration Dashboard | Success Rate %, Average Duration, Failed API Count |
Shopify Integration Monitor | Orders Imported vs Errors |
3PL Dashboard | Shipment Updates, Label Generation Failures |
Salesforce Sync Log | Lead Push, Opportunity Updates |
RESTlet API Summary | Total Calls, Status Breakdown, Retry Trend |
Add these dashboards as Home Portlets for Admin or IT Operations roles.
๐งฉ Advanced Features (Optional)
Feature | Description |
---|---|
Retry Button | Add workflow button to reprocess failed entries via Suitelet. |
Payload Archiving | Save large JSON payloads to File Cabinet instead of record field. |
Integration ID Linking | Add field custrecord_related_transaction for traceability. |
Governance Tracking | Log script usage units for each API call. |
External Alerts | Send Slack/Teams notifications for failures via webhook. |
๐ Security & Performance Best Practices
โ
Limit record visibility to Admin & Developer roles.
โ
Truncate old logs (>90 days) via scheduled script.
โ
Avoid storing sensitive credentials in payload fields.
โ
Use N/cache
to reduce API lookup time.
โ
Compress JSON payloads using JSON.stringify(obj, null, 0)
for efficiency.
โก Common Issues & Fixes
Issue | Root Cause | Solution |
---|---|---|
Missing logs | Script didnโt save record | Verify record.create() logic |
High storage usage | Large payloads | Save payloads to File Cabinet |
Duplicate entries | Retry logic not tracked | Add externalId uniqueness check |
No alerts | Workflow condition mismatch | Verify โFailedโ status condition |
๐ Related Tutorials
- ๐ SuiteScript Security & Governance Best Practices
- ๐ Custom GL Plug-in for Audit Compliance
- ๐ SuiteAnalytics Workbook for Dashboards
โ FAQ
Q1. Can this log be used for Boomi or Celigo integrations?
Yes โ simply send API responses into this RESTlet from your middleware.
Q2. Can I link integration logs to original transactions?
Yes โ add a field custrecord_related_transaction
to link to Sales Orders or Invoices.
Q3. Can I visualize this data externally?
Yes โ use SuiteAnalytics or export via Saved Search API to Power BI or Tableau.
Q4. Can I auto-delete old logs?
Yes โ use a Scheduled Script or Workflow to purge records older than 90 days.
๐งญ Summary
The Integration Logging & Monitoring Dashboard transforms NetSuite into a central integration control center.
By tracking every API call, logging payloads and outcomes, and visualizing success/failure trends, you gain full transparency and control across all external systems โ Shopify, Salesforce, Boomi, 3PLs, and more.
This setup is essential for modern ERP teams that value visibility, accountability, and proactive troubleshooting.
Leave a Reply