This notice applies to customers who make requests to Suitelets in your account from shoppers using the Suitelet’s internal URL. From October 20, 2024, access to the internal URL of the Suitelet for the Shopper role requires an additional parameter. Visitors to your web site are assigned the Shopper role to maintain their session while browsing. With the Shopper role, users can access the internal Suitelet URL for a Suitelet with the Available Without Login and Select All Roles boxes checked if you have used the internal URL instead of the external URL in your site design. This may be done in an effort to maintain the user’s session, including cart items.
What is changing?
After October 20, 2024, you must include an additional parameter &ns-at=<VALUE> in the internal URL to keep the Suitelet available for users with the Shopper role while maintaining the user’s session. The <VALUE> should match the value of this parameter in the external URL field on the script deployment record for the Suitelet.
Required actions
Option 1: Use the external URL - If you do not need to maintain the user’s session, you can replace the Suitelet’s internal URL with the external URL, which already contains the &ns-at=<VALUE> parameter. If the URL is accessed from the server side, use url.resolveScript to construct the external URL:
function resolveScript_shopperUrl({ scriptId, deploymentId })
{
const externalUrl = url.resolveScript({
scriptId: scriptId,
deploymentId: deploymentId,
returnExternalUrl: true
});
}
If the URL Is accessed from the client side and you do not need to maintain the session, you must hard-code the external URL from the Suitelet script deployment record. Note: The Suitelet deployment must have the Available Without Login preference enabled to show the external URL. Option 2: Append the &ns-at=<value> parameter to the internal URL - If you need to maintain the user’s session and the URL is accessed from server side, use url.resolveScript to construct the internal URL with the parameter from the external URL appended.
function resolveScript_shopperUrl({ scriptId, deploymentId })
{
const internalUrl = url.resolveScript({
scriptId, deploymentId });
const externalUrl = url.resolveScript({
scriptId, deploymentId, returnExternalUrl: true });
const newParameter = externalUrl.match(/&ns-at=[^&]+/)[0];
return internalUrl + newParameter;
}
If the URL is accessed from the client side, you must construct the internal URL manually with the external URL parameter.
- Go to the Suitelet’s script deployment record at Customization > Scripting > Script Deployments.
- Copy the internal URL.
- Copy the
&ns-at=<VALUE> parameter from the external URL field. - Append it to the internal URL.
Your internal URL available for shoppers should now be in the following format. You can hard-code this URL in your site for URLs accessed on the client when the session needs to be maintained:
/app/site/hosting/scriptlet.nl?script=<SCRIPT_ID>&deploy=<DEPLOY_ID>&ns-at=<VALUE>
If you have additional questions, please contact NetSuite Customer Support.