Browsed by
Author: Adolfo Garza

You are not crazy, SS2.0 External Suitelets don’t run clientside code

You are not crazy, SS2.0 External Suitelets don’t run clientside code

Hey guys, just letting you know that I encountered an issue recently. I was trying to create a Suitelet “Available without Login” that uses a form and I was attaching a button and a clientscript to it, but guess what? The button doesn’t work. I checked the console and every time I call the button I get “require is not defined” error:

8pJdqVF

So I stripped the suitelet to the most barebones version and I still got the error. I verified with others and it seems to be a defect from SS2.0 External Suitelets.
At the end of the day I was able to run the code by hacking the dom like so:

and as the clientscript file I have this:

Totally not recommended, but just throwing it out there.

Youtube Fix Ctrl+F

Youtube Fix Ctrl+F

I created the Chrome Extension Youtube Fix Ctrl + F because I prefer to use Ctrl + F for finding some text in the page.

The extension stops youtube from going into fullscreen when you press Ctrl+F. Credits to Adrien Pyke for his GreaseMonkey script.

There are no menus involved. Just install and the plugin will take care of the rest.

Tested on Windows.

Comment below if you have issues or want to request something.

Snippet to create a delay in a server side script

Snippet to create a delay in a server side script

The motivation behind the creation of this function stems from the absence of a built-in setTimeout functionality in the server-side environment of Netsuite. Although I personally had not encountered the necessity for such a function, I recognized the potential value it could hold for others facing similar circumstances.

It is essential to note that the provided code relies on a busy-wait mechanism, which is widely acknowledged as an antipattern and discouraged for use. This approach involves a loop that continuously checks the system clock until the specified duration elapses. While it serves as a makeshift alternative, it is important to exercise caution and consider alternative solutions whenever possible.

For your convenience, the function is provided below:

 

And then call it like this:

Beware of execution time limits when running this code. Always test first.

By incorporating this function into your code, you can simulate a delayed execution of a specified function after a given time period. However, it is advisable to explore more efficient and reliable alternatives for handling time-based operations in Netsuite’s server-side environment.