I am trying to learn how to create a script for a custom portlet for the dashboard. I was using the help pages here to learn.
Portlet Script Examples
When I try to add these into my sandbox environment, I get an error when trying to create the script record. Does anyone know know what is wrong here? Are the help pages outdated?
I am unable to attach the javascript files so here are the two examples of code I chose to try and learn from that I can't get added into NetSuite.
Links and Indents
/** * @NApiVersion 2.x * @NScriptType Portlet */// This sample creates a portlet with two linksdefine([], function() { function render(params) { var portlet = params.portlet; portlet.title = 'Search Engines'; portlet.addLine({ text: 'NetSuite', url: 'http://www.netsuite.com/' }); portlet.addLine({ text: 'Oracle', url: 'http://www.oracle.com/' }); } return { render: render };});
inlineHTML
/** * @NApiVersion 2.x * @NScriptType Portlet */// This sample creates a portlet that displays simple HTMLdefine([], function() { function render(params) { params.portlet.title = 'My Portlet'; var content = '<td><span><b>Hello!!!</b></span></td>'; params.portlet.html = content; } return { render: render };});