Script Types
SuiteScript Portlet Scripts
Using Portlet Scripts
SuiteScript portlet scripts customize dashboard portlets.
Introduction to SuiteScript Portlet Scripts
SuiteScript portlet scripts are a powerful feature in NetSuite that allow developers to create custom dashboard portlets. These portlets can display a variety of data, offering a personalized view tailored to the needs of specific users or roles. By leveraging SuiteScript, you can enrich the user experience with dynamic and interactive content directly on the dashboard.
Types of Portlets
There are several types of portlets you can create using SuiteScript:
- List Portlet: Displays a list of records or data.
- Form Portlet: Provides a form interface for user input.
- HTML Portlet: Renders HTML content, ideal for custom web components.
- Trend Graph Portlet: Visualizes data trends over time.
Creating a Basic HTML Portlet
HTML Portlets are commonly used due to their flexibility. Below is an example of how to create a simple HTML portlet that displays a welcome message.
Deploying Your Portlet Script
Once you've created your portlet script, you'll need to deploy it in NetSuite:
- Navigate to Customization > Scripting > Scripts and upload your script file.
- Create a script deployment by going to Customization > Scripting > Script Deployments, and associate it with your script.
- Set the deployment status to 'Released,' and specify the audience who should see the portlet.
Best Practices for Portlet Scripts
To ensure your portlet scripts run efficiently and provide the best user experience, consider the following best practices:
- Optimize Performance: Minimize DOM manipulation and avoid unnecessary script execution.
- Security: Validate and sanitize all data displayed in the portlet to prevent XSS attacks.
- UX Design: Ensure the portlet layout is user-friendly and accessible.
Script Types
- Previous
- Workflow Action Scripts
- Next
- RESTlets