Browsed by
Category: Netsuite Tips

Downloading Suitescript APIs To Enable Code Assist

Downloading Suitescript APIs To Enable Code Assist

Having Suitescript API javascript files available locally is useful for enabling code assist features in some IDE’s like Eclipse and Brackets. To download the files just head to Netsuite’s File Cabinet and you will find the files right above the “Delete Files” button:

More info on how to integrate it with your IDE available here.

Running client script in view mode

Running client script in view mode

In order to run clientscript in view mode you need to modify the form on BeforeLoad using a UserEvent script and attach a Clientscript file to the form using clientScriptFieldId function. Here’s some examples on how to do it:

 

Suitescript 1.0:

Here’s what you would have in your 1.0 Clientscript customscript_yourscriptid file:

Note: The Clientscript record doesn’t need to be deployed, you don’t need to fill the function names either. As long as it exists the logic will run.

Suitescript 2.0:

Here’s what you would have in your 2.0 Clientscript file:

Suitescript 2.0 InlineHTML Hack:

If you need to run your code without having to click a button you can try the the following code. This code injects a script into the form to hack the DOM. In other words it’s a hack.

The following code is a hack. Use carefully.