🧩 Business Use Case
You’re building a Suitelet that displays a list of transactions or customers. You want to add a dashboard icon next to each record, just like in NetSuite’s native entity lists, so users can click to jump to that record’s dashboard.
This improves usability and replicates NetSuite’s own native user experience — helpful for internal tools or role-specific summary pages.
🎯 Goal
✅ Add a clickable “View Dashboard” icon column to a custom Suitelet list.
✅ Dynamically link each row to the corresponding entity’s Dashboard usingaddParamToURL.
✅ Use a custom free-form transaction field with an embedded icon image.
🛠️ Setup Instructions
1. 🔧 Create a Custom Field (Transaction Body Field)
Navigate to:
Customization → Lists, Records, & Fields → Transaction Body Fields → New
Then fill out:
| Field | Value |
|---|---|
| Label | Dashboard |
| Type | Free-Form Text |
| Store Value | Leave unchecked |
| Image ID | _dashboard_image |
Under Validation & Defaulting tab:
- ✅ Check Formula
- In Default Value, paste this exact string (including quotes):
'<img src="/images/nav/ns_x.gif" height="13" width="16" border="0" title="View Dashboard" class="i_dashboard_gray">'
Click Save.
2. 🧑💻 Suitelet Script to Display the List with Dashboard Link
Save the below code as SuiteletDashboard.js:
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/ui/serverWidget', 'N/search'], function (serverWidget, search) {
function demoList(context) {
var list = serverWidget.createList({ title: 'Customer Estimates with Dashboard Link' });
// Add the Dashboard Icon Column
var dashboardCol = list.addColumn({
id: 'custbody_dashboard_image',
label: 'Dashboard',
type: serverWidget.FieldType.TEXT,
align: serverWidget.LayoutJustification.LEFT
});
dashboardCol.setURL({
url: 'https://system.netsuite.com/app/center/card.nl?sc=-69'
});
dashboardCol.addParamToURL({
param: 'entityid',
value: 'entity',
dynamic: true
});
// Other Columns
list.addColumn({ id: 'trandate', label: 'Date', type: serverWidget.FieldType.DATE });
list.addColumn({ id: 'name_display', label: 'Customer', type: serverWidget.FieldType.TEXT });
list.addColumn({ id: 'salesrep_display', label: 'Sales Rep', type: serverWidget.FieldType.TEXT });
list.addColumn({ id: 'amount', label: 'Amount', type: serverWidget.FieldType.CURRENCY });
// Pull Estimates
var estSearch = search.create({
type: search.Type.ESTIMATE,
filters: [['mainline', 'is', 'T']],
columns: ['trandate', 'entity', 'name', 'salesrep', 'amount', 'custbody_dashboard_image']
});
var results = estSearch.run().getRange({ start: 0, end: 1000 });
list.addRows({ rows: results });
context.response.writePage({ pageObject: list });
}
return { onRequest: demoList };
});
3. 🚀 Deploy the Script
Customization → Scripting → Scripts → New
- Upload the file
- Click Create Script Record
- Name:
View Dashboard Suitelet
Under Deployments tab:
- Title:
View Dashboard Suitelet - Status:
Released
Click Save.
🧪 Sample Output
When you run the Suitelet, each row will show a little gray dashboard icon (📊). When clicked, it takes you to the Dashboard of the customer associated with that row — just like native NetSuite behavior.
🧹 Troubleshooting Tips
| 🔴 Error Message | ✅ Fix |
|---|---|
| “Your formula has an error…” | Make sure your Default Value is wrapped in single quotes (`’…’) |
| Icon doesn’t show | Confirm Image ID is exactly _dashboard_image |
| URL links all go to same dashboard | Check that addParamToURL uses dynamic: true and correct value: 'entity' |
🧠 Summary
This real-world enhancement brings a powerful NetSuite-native user experience into your custom Suitelets. With just a few lines of code and a smart custom field setup, you can embed dynamic entity dashboard links into any list — perfect for executive dashboards, sales portals, and role-specific reports.
Leave a Reply