Script Types
SuiteScript Portlet Scripts
Using Portlet Scripts
SuiteScript portlet scripts customize dashboard portlets.
Understanding SuiteScript Portlet Scripts
SuiteScript portlet scripts allow developers to customize the NetSuite dashboard by creating dynamic and interactive portlets. Portlets are small, modular panels that display information and provide functionality directly on the dashboard. With portlet scripts, you can enhance user experience by making these panels more informative and tailored to specific business needs.
Types of Portlet Scripts
There are several types of portlet scripts that you can create in SuiteScript:
- Form Portlet: Allows for the display of a form with input fields.
- List Portlet: Displays a list of NetSuite records.
- HTML Portlet: Allows for custom HTML content, including scripts and styles.
- Simple Portlet: Used for displaying basic information without complex interactions.
Creating a Simple HTML Portlet Script
To create an HTML portlet, you need to define a SuiteScript file with a specific entry point function called render
. This function will generate the HTML content to be displayed in the portlet.
Deploying Your Portlet Script
Once you've written your portlet script, you need to deploy it in NetSuite. This involves creating a script record and assigning it to the desired dashboard. You can do this by navigating to Customizations > Scripting > Scripts, then creating a new script record and uploading your SuiteScript file. Next, you will create a deployment for the script, specifying where it should appear in the UI.
Best Practices for Portlet Scripts
- Ensure your scripts are optimized for performance, as portlets are loaded on the dashboard and can affect load times.
- Use minimal external libraries to reduce dependencies and potential conflicts.
- Test your portlet scripts in a sandbox environment before deploying them to production.
- Keep user experience in mind, ensuring the portlet is intuitive and adds value to the dashboard.
Script Types
- Previous
- Workflow Action Scripts
- Next
- RESTlets