HOW TO INCLUDE HTML AND CSS IN SUITELET SCRIPT?

Suitelets are of two types- Front end and Back end. Front end suitelet is used for creating forms, assistants etc. Sometimes we can't create the UI by using only Netsuite API's. We might have to use html and css to build the page. The following ocde shows how it can be done:
Email : info@smilingcoders.com

  var html = '<!DOCTYPE html>\n'
            +'<html>\n'
            +'<head>\n'
           +'<link href="https://system.netsuite.com/core/media/media.nl?id=1234&_xt=.css" rel="stylesheet" media="print" />\n'
// replace this with your css url from file cabinet
            +'</head>\n'
            +'<body>\n'


            +'<h2>HTML Forms</h2>\n'

             +'<form action="/action_page.php">\n'
             +' First name:<br>\n'
             +'<input type="text" name="firstname" value="Mickey">\n'
             +'<br>\n'
             +'Last name:<br>\n'
             +'<input type="text" name="lastname" value="Mouse">\n'
             +'<br><br>\n'
             +'<input type="submit" value="Submit">\n'
             +'</form> \n'

             +'<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>\n'

             +'</body>\n'
              +'</html>\n';

response.write(html);
Email : info@smilingcoders.com

Comments

  1. Thanks for sharing. It is beneficial.

    ReplyDelete
  2. We are NetSuite Solution Provider with vast experience in NetSuite Implementation, netsuite customization including netsuite training & netsuite integration.
    NetSuite Solution Provider
    NetSuite Training
    NetSuite Implementation
    NetSuite Customization
    NetSuite Integration

    ReplyDelete

Post a Comment

Popular posts from this blog

Work Around the 1000 Row Limit Returned by Saved Searches in Netsuite

USING CASE (IF AND ELSE) IN NETSUITE SAVED SEARCH- NETSUITE ACADEMY

Understand Core Technology behind SuiteScript 2.0