Summary:
This guide walks through creating and deploying a basic SSP page in NetSuite SCA.
Steps:
- Create the SSP File:
- Navigate to your local SCA workspace.
- Under
Modules/<YourModule>/SuiteScript, create a file likeCustomPage.ss. - Example:
javascript
Copy
Edit
<%
var message = "Welcome to the custom page!";
%>
<html>
<body>
<h1><%= message %></h1>
</body>
</html>
- Add the Route in
ssp_libraries:
- Define a new route in the
router.jsof your SSP application. - Example:
javascript
Copy
Edit
function onRequest(context) {
var response = '<h1>Custom SSP Route</h1>';
context.response.write(response);
}
- Deploy to NetSuite:
- Upload the SSP file via File Cabinet.
- Ensure it is referenced in the correct SSP application.
- Update the Site Configuration to map the route if necessary.
- Test Your Page:
- Navigate to
https://<yourdomain>.com/c.<accountnumber>/customroute.ssto view the page.
Best Practice:
Always test in sandbox and handle errors gracefully using try-catch blocks.