Hello, Can anyone help me to understand if it is p...
# suitescript
s
Hello, Can anyone help me to understand if it is possible to render a html file in suitelet 2.0?
s
use the N/render module
steps to render HTML: step 1: create render object var renderer = render.create();
step 2: to that add the html file content renderer.templateContent = xmlTemplateFile.getContents();
step 3: var templateString = renderer.renderAsString(); it will return as string
step 4: use response.write(templateString)
s
But how can I pass the data from suitelet to html ? @sayyad
s
which type of data you want to pass in html? is it record, search result or custom data? @samyt
These three can be achieved in 3 different ways TemplateRenderer.addCustomDataSource(options) TemplateRenderer.addRecord(options) TemplateRenderer.addSearchResults(options)