Shannon
08/22/2024, 9:29 AMCeligo AI
08/22/2024, 9:30 AMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** Based on the conversations, it seems like you're trying to use JavaScript in a NetSuite portlet. However, it's important to note that NetSuite has certain restrictions when it comes to using JavaScript in portlets. In the first thread, the user was trying to use
window.addEventListener
in a portlet script, but it wasn't firing. This could be due to the iframe the portlet is in, and adding the listener to one of the parent windows might be a solution. However, the user reported that this approach didn't work.
In the second thread, a user suggested using a custom form portlet with client code that clicks refresh on an interval. However, this approach might fall under the category of unsupported DOM access. Here's the code snippet provided:
javascript
setInterval(function() {
var collection = window.top.document.getElementsByClassName(
"ns-portlet-icon ns-portlet-icon-refresh ns-portlet-action"
);
for (var i = 0; i < collection.length; i++) {
collection[i].click();
}
}, 60000);
In the third thread, a user confirmed that NetSuite might strip out script tags from an inline HTML portlet. They suggested using Portlet.clientScriptModulePath
and Portlet.addField
for form portlets. If you really wanted to use the HTML portlet, then some XSS attacks might work, but this is not recommended due to security concerns.
In conclusion, while it's possible to use JavaScript in a NetSuite portlet, there are certain restrictions and limitations that you need to be aware of. It's always best to follow NetSuite's guidelines and best practices when working with portlets.Celigo AI
08/22/2024, 9:30 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82114476
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815472662
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811496496
Celigo AI
08/22/2024, 9:30 AM