How to pass data/parameter from Suitelet to HTML

For loading the html page the syntax is var HTML_FILE_ID = 464444; // NetSuite File id var fileContent = file.load(HTML_FILE_ID).getContents(); BY this syntax we can load this page , but can’t pass data for passing data write this line code in suitelet fileContent = fileContent.replace(/REPLACE_INTENT_HERE/g, response.body); And in Html Code add line code as: const… Continue reading How to pass data/parameter from Suitelet to HTML

How to link Suitelet in Html

we can link suitelet page for POST response in Html by using Ajax method syntax for linking $.ajax({ type: “POST”, url: “/app/site/hosting/scriptlet.nl?script=826&deploy=1&compid=TSTDRV2570977&h=db87afcaddd762a08db6”, // suitelet external link dataType: “json”, data: { paymentIntentId: paymentIntentId, result } });

Customer portal login

https://<accountID>.app.netsuite.com/app/login/secure/oidcprivate.nl for the Customer Center roles, Use this link for login as customer instead using enterprise login link where <accountID> is a variable representing the NetSuite account ID. Send Login Link Via E-mail Navigation Setup -> company -> system email template Add login link in email template

Closing Suitelet Popup and Reloading parent Record

For closing the Suitelet popup SYNTAX window.close(); For reloading the parent record SYNTAX window.opener.location.reload(); Add above syntax’s in suitelet POST request inside Script Tag SYNTAX var html = html + ‘<script> window.opener.location.reload();window.close() </script>’; scriptContext.response.write(html);

Request Body in Postman

When we send the request as JSON string method from postman to Restlet .The request body should be parse to object to get values We give input in postman as { “id”:”345″ } In script we need object not string so the given request body need to parse Syntax JSON.parse(requestBody)

Show Script Internal ID

To show the script Internal ID select the show all internal id check box in set preferences select the check box to show the internal ids