How to change the page based on suite let button by using HTML

const buttonCode = `<!DOCTYPE html>

<html lang=”en”>

<head>

<meta charset=”UTF-8″>

<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

<style>

.button-container {

  text-align: center;

}

.button-container input[type=”submit”] {

  display: inline-block;

  width:120px;

  background-color: #003366;

  color: white;

  border: none;

  cursor: pointer;

  padding: 10px 20px;

  border-radius: 5px;

  font-size: 12pt;

  margin: 0 10px;

}

.button-container input[type=”submit”]:hover {

  background-color: #0E86D4;

}

</style>

</head>

<body>

<div class=”button-container”>

  <form action=”#” method=”post”>

    <input type=”submit” value=”Home Page”  onClick=”homePage()”>

  </form>

</div>

<script>

function homePage() {

  window.open(“https://6714807-sb1.extforms.netsuite.com/app/site/hosting/scriptlet.nl?script=1991&deploy=1&compid=6714807_SB1&h=ca4bacdb2f7773f88246&whence=”);

  window.close();

  window.history.forward();

}

</script>

</body>

</html>`;

The suite let button code :

 let homePage = form.addField({

                        id: ‘custpage_homepage’,

                        type: serverWidget.FieldType.INLINEHTML,

                        label: ‘Home Page’

                    });

                    homePage.updateLayoutType({

                        layoutType: serverWidget.FieldLayoutType.OUTSIDE

                    });

                    let homePageCode = buttonCode;

Leave a comment

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