Using the Include Tag for SSP Files in NetSuite
The include tag simplifies referencing scripts in .ssp files, enhancing organization within SSP applications.
The include tag is recommended for use in .ssp files to maintain a clean and efficient method of referencing scripts. This approach is superior to listing scripts as library files, fostering better code organization and accessibility.
How to Upload Assets to an SSP Application Folder
After creating an SSP application record, you can upload scripts, images, and other assets for your web store customization. Follow these steps to upload assets:
- Go to Commerce > Hosting > Website Hosting Files.
- Select the appropriate Web Site Hosting Files folder and then the corresponding SSP Applications folder.
- Choose the application publisher and the SSP application folder to modify.
- Create new subfolders such as style sheets, images, JavaScript, and SuiteScript within your SSP application folder.
- Add files as necessary.
- For further details on uploading files, refer to the File Cabinet Overview documentation.
Note: SuiteScript developers must upload .ssp and .ss files to the SSP Applications folder, not the SuiteScript folder in the File Cabinet.
How to Use the Include Tag
In your .ssp files, use one of the following formats to include scripts:
<%@include file='file'%><%@include file='/path'%>Notes on Path Referencing
- If the path begins with
/, it is relative to the root folder of the SSP application. - If it does not start with
/, the reference points to a file in the same folder as the asset that is referencing it. - Files from outside the SSP application cannot be accessed via the include tag.
Benefits of Using the Include Tag
- Improved Organization: Utilizing the include tag helps keep your codebase cleaner, reflecting a more modular structure.
- Ease of Maintenance: Changes to referenced scripts need only be made in one location, reducing the chance of error and simplifying updates.
Related Topics
- Enable Required Features for SuiteScript 1.0 SSP Applications
- Create a SuiteScript 1.0 SSP Application Record
- Set Execute as Role Permissions for .ss and .ssp Files
- Link a Website or Domain to an SSP Application
- Debug a SuiteScript 1.0 SSP Application
By following these guidelines on the include tag and managing your SSP assets effectively, you ensure a streamlined development process for your web store.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- Use the include tag for better script management in .ssp files.
- Organizing scripts within subfolders enhances clarity.
- Paths can be absolute or relative based on structure.
- Upload scripts specifically to the SSP Applications folder.
Frequently Asked Questions (4)
Does the include tag for SSP files apply to both NetSuite versions 1.0 and 2.0?
What paths should be used with the include tag in .ssp files?
Can the include tag reference files outside the SSP application using an absolute path?
Where should SuiteScript developers upload .ssp and .ss files?
Was this article helpful?
More in SuiteScript
- Scheduling Map/Reduce Script Submissions in NetSuite
Learn how to schedule map/reduce scripts for one-time or recurring submissions in NetSuite, enhancing automation and efficiency.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- Attach and Detach Operations in NetSuite 2026.1
Attach and detach operations for record relationships in NetSuite enhance data management and connectivity.
