Can I send parameters to single page application
# ask-stanley-ai
t
Can I send parameters to single page application
c
AI generated answer (using internal Slack threads):
Yes, you can send parameters to a single page application (SPA) in NetSuite. This can be achieved by structuring a suitelet that creates a basic form with just a single inline HTML field. The inline HTML field can load the SPA in an iframe. Additionally, you can redirect from a Client Script to a Suitelet, while passing parameters from the former to the latter. You can get the URL of your suitelet (using
N/url
), and set the
window.location.href
in the client script, appending any parameters you would like to the URL with
&paramName=paramValue
. Here is a code sample that demonstrates how to set a function name on a button and pass parameters to a Suitelet:
Copy code
javascript
//Suitelet
var urlSuiteLet = url.resolveScript({
   scriptId: 'customscript_ns_sl_print_ship_inv',
   deploymentId: 'customdeploy_ns_sl_print_ship_inv',
   returnExternalUrl: false,
   params: {
      transactionId: recCurrent.id,
   }
});

objForm.addButton({
   id: 'custpage_printshipinvoice',
   label: 'Print Ship Invoice',
   functionName: "window.open('" + urlSuiteLet + "','_blank')"
});
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805493772
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805276394
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.801156759
Please provide your feedback on this answer.