TO LOAD A HTML FILE IN SUITELET

the code sample is used to load the html content in suitelet.

 let htmlFile = file.load({

              id: constants.filePaths.UPDATE_SO_PAGE_HTML

            });

            let htmlContent = htmlFile.getContents();

            htmlContent = htmlContent

              .replace(/${fullFileUrl}/g, fullFileUrl)

              .replace(/${backgroundFileUrl}/g, backgroundFileUrl)

              .replace(/${urlUpdateSO}/g, urlUpdateSO)

            scriptContext.response.write(htmlContent);

          }

The code will load the html page.

The replace function is used to replace with the contents in the netsuite.

Leave a comment

Your email address will not be published. Required fields are marked *