Update Record With Button When Viewing In Browser: User Event & Client Scripts

How do you add an actionable button on the client-side view of a record in Netsuite that would allow the user, once the button is clicked, to insert something into the current record and have the changes saved to the record? I had a recent requirement where a button was needed on the client side when viewing a record. The intent was that if the user needed to update the record the button would invoke the process for refreshing the content on the record and update any necessary fields. ...

March 11, 2023 · 7 min · 1444 words · Ryan Sheehy

SuiteScript Change On Credit Hold Field On Customer Record

How do you change the Hold field found on the customer record using SuiteScript? The Hold field in a Customer record prevents users or the customer from having any new Sales Orders being placed and has three settings On, Off and Auto. The code name of the field is creditholdoverride. To set the value for this field using SuiteScript, enter the value in all capital letters according to the value you want. ...

October 5, 2022 · 2 min · 259 words · Ryan Sheehy

How To Create A Radio Button In Suitelet Form

How do you create a radio button in a Suitelet form? To create a series of radio button elements in a Suitelet form you need to add each element of the radio series as distinct fields using the .addField function. The id property needs to be the same for each radio field and the source property needs to be unique for each element. Here’s an example demonstrating what this would look like where the user is required to select the option of “Direct Debit” or “Credit Card”: ...

September 28, 2022 · 4 min · 785 words · Ryan Sheehy

Add Button To Record Using Client Script And User Event Script: SuiteScript

How can you add a button to a record in NetSuite that can be used to trigger a process regardless of whether the record is being viewed or edited? Creating a button on a client script does have the problem where it can only be accessed when the record is in EDIT mode which doesn’t help when you want to trigger a process when the record is in VIEW mode. ...

June 1, 2022 · 7 min · 1314 words · Ryan Sheehy

NetSuite RESTlet Example (OAuth1): Send File Using Python

How do you send a file through to your NetSuite instance via a RESTlet using a Python Script? If you know how to send a POST request through to a RESTlet using Python then only minor modifications need to be made to enable the sending of a file. One reason why you may prefer sending a file for NetSuite process is where you have a lot of data to consume and would prefer sending the consumption of the data through a Map/Reduce script. The RESTlet would then be responsible for capturing the data files, and then triggering the Map/Reduce script to process the data. ...

May 11, 2022 · 8 min · 1630 words · Ryan Sheehy

NetSuite RESTlet Example (OAuth1): Python Script To RESTlet

How do you send data to your NetSuite RESTlet using Python? To send data to your NetSuite RESTlet using Python code utilise the handy requests_oauthlib library. If you need to upload a series of CSV files and want to perform some data cleaning before being uploaded and want to avoid the Import CSV process then you can create a simple RESTlet and insert your clean data directly. Create Your RESTlet First, create your RESTlet and make it perform the basic tasks needed to import the data you want. ...

May 10, 2022 · 7 min · 1347 words · Ryan Sheehy

How To Use FORMULA In Filter Expression - SuiteScript 2.0

I had recently had to use a FORMULA type in a SuiteScript 2.0 search and found it as a very useful filter for list values. To use FORMULA types in a filter expression, such as, FORMULATEXT, FORMULAPERCENT, FORMULANUMERIC, FORMULACURRENCY or FORMULADATETIME just prefix the type of FORMULA at the beginning of your filter expression and then write your formula. Use the operator and value as you normally would with any other filter expression. ...

June 1, 2021 · 2 min · 405 words · Ryan Sheehy

SuiteScript UNEXPECTED_ERROR With RESTlet

A recent project hit a roadblock when I changed some code depending on the N/search module and refactored it to use N/query module. While I had some initial hassles with accepting the Beta nature of the N/query script I soon ran into another error once I had got the code to a level I knew would work: { "error": { "code": "UNEXPECTED_ERROR", "message": "An unexpected SuiteScript error has occurred" } } Great. ...

April 1, 2021 · 7 min · 1383 words · Ryan Sheehy

Best Set Up For SuiteScript Coding in WebStorm

As mentioned in my previous post on what my preferred text editor is for SuiteScripting NetSuite does provide a deeper integration with JetBrains’ WebStorm product through a plugin. To enable this plugin in WebStorm you will need to access this help page in NetSuite’s documentation and follow the step by step guide. (The process is fairly straightforward, but unfortunately the plugin doesn’t play well with PyCharm.) Once you then have the plugin installed in WebStorm you then need to ensure you undertake (or already have done) the following steps: ...

February 14, 2020 · 2 min · 275 words · Ryan Sheehy

Best Editor For Coding SuiteScript Seamlessly

If you’re looking for a good text editor to perform your SuiteScript coding there are good editors, such as Microsoft’s Visual Studio Code, but the one I personally use on a regular basis is PyCharm. Both platforms enable you to: Write and analyse your JavaScript code; Have integrated terminal and console windows; Git integration; Ability to code in other languages, such as Python (great for web-scraping and data analysis of your saved search csv files!); and Connection to your SuiteScript File Cabinet (although the plugin for VSCode is a little more cumbersome to set up), and once setup you can then upload directly to your project’s folder in NetSuite. Both are free PyCharm Community Edition, although I have an Ultimate licence that provides access to all of JetBrains products). PyCharm and the more commonly known other JetBrains IDE WebStorm have been around for quite some time, and I have been more familiar with their product because of this. ...

January 13, 2020 · 2 min · 246 words · Ryan Sheehy