Display an HTML page when a Suitelet link is clicked

let filePath = '../Views/jj_index.html' // Path of the HTML file
let fileObj = file.load({ id: filePath });
if (fileObj) {
    let fileContent = fileObj.getContents();
    this.scriptContext.response.headers['Content-Type'] = 'text/html';
    this.scriptContext.response.write(fileContent);
} else {
    this.scriptContext.response.write('HTML file not found');
}           

Leave a comment

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