Totally new here. Watched one video on SuiteScript...
# suitescript
r
Totally new here. Watched one video on SuiteScript for non-devs. Simple concept to load a CSS file (in my File Cabinet) on a page... Am I ready to deploy? 🤷
Copy code
/**
  *@NApiVersion 2.x
  *@NScriptType ClientScript
  */
 define([], function() {
 
 // Create new link Element 
 var link = document.createElement('link');  
   
 // set the attributes for link element 
 link.rel = 'stylesheet';  
 link.type = 'text/css'; 
 link.href = 'styles.css';  
 // Get HTML head element to append and link element to it  
 document.getElementsByTagName('HEAD')[0].appendChild(link);
 
 });
b
you probably tried already, but client script requires you to return an object that implements an entry point function
for your particular case, id say you need to use a valid href
potentially you could use an inline html field to accomplish what you are doing and avoid the script altogether