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:
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);
Feel free to reach your NetSuite Solution Provider , TheSmilingCoders for proper netsuite implementation, netsuite consultation , netsuite customization, netsuite Support,netsuite Training, contact us at:
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);
Feel free to reach your NetSuite Solution Provider , TheSmilingCoders for proper netsuite implementation, netsuite consultation , netsuite customization, netsuite Support,netsuite Training, contact us at:
Email : info@smilingcoders.com
Thanks for sharing. It is beneficial.
ReplyDeleteWe are NetSuite Solution Provider with vast experience in NetSuite Implementation, netsuite customization including netsuite training & netsuite integration.
ReplyDeleteNetSuite Solution Provider
NetSuite Training
NetSuite Implementation
NetSuite Customization
NetSuite Integration