The client needs to display a custom portlet in their dashboard. The portlet should display a table that was created on an HTML page.
/**
* @NApiVersion 2.1
* @NScriptType Portlet
*/
define(['N/ui/serverWidget'],
/**
* @param{render} render
* @param{serverWidget} serverWidget
*/
function ( serverWidget) {
/**
* Defines the Portlet script trigger point.
* @param {Object} params - The params parameter is a JavaScript object. It is automatically passed to the script entry
* point by NetSuite. The values for params are read-only.
* @param {Portlet} params.portlet - The portlet object used for rendering
* @param {string} params.column - Column index forthe portlet on the dashboard; left column (1), center column (2) or
* right column (3)
* @param {string} params.entity - (For custom portlets only) references the customer ID for the selected customer
* @since 2015.2
*/
const render = (params) => {
try {
let portlet = params.portlet;
portlet.title = 'KPI Custom Portlet'
let html = '<iframe id="kpi_indicator" src="https://7036058-sb1.app.netsuite.com/core/media/media.nl?id=196674&c=7036058_SB1&h=L0LFGyzpVKhglzFj-R2pS4FCF-hraW_mtjD8Y2N7krV9vy7R&_xt=.html" width="100%" height="700"></iframe>'
var graphField = portlet.addField({
id: '_graph',
type: 'inlinehtml',
label: 'Graph'
});
graphField.defaultValue = html;
}
catch (e) {
log.debug("error",e);
}
}
return {render}
});