Recently I have had a chance to work on NetSuite. It took me some time to get familiar and then start doing development in NetSuite. In the process of learning NetSuite I referred to a lot websites, NetSuite documentation. I have now started getting a better handle and confidence of how things work in NetSuite & what can/cannot be done in NetSuite. So far, I like it & it’s still a learning process.

In this process, I have learnt a few things the hard way, and hence thought of consolidating my experiences and learning via few blogs. It may save some time to newbies, onboarding on NetSuite.

Introduction: NetSuite allows customization through a SuiteFlex.SuiteFlex is the technology toolkit for data integration within the NetSuite platform. For developers, SuiteFlex provides a complete set of tools and API’s for accessing or modifying NetSuite’s records. NetSuiteTechniques-NetSuite’s most used techniques for data modifications are SuiteTalk and SuiteScript. SuiteTalk-SuiteTalk exposes NetSuite’s data as soap based web service. Using this APIs a developer can access NetSuite without using the web browser. An outside application or a third party interface can communicate to NetSuite via SuiteTalk. SuiteTalk uses java or .net.

The following are common scenarios where SuiteTalk can be used to develop applications and services.

1.An application that performs data sync between NetSuite and an external database.

2.Importing data form csv file into NetSuite.

SuiteScript-It is java script referred by NetSuite as SuiteScript. Using java script on the client side is common, but NetSuite also uses it on server side. A lot of business logic can therefore be run either on the client or server or both. Client script allows connecting to any external URL. Behind the scene NetSuite is actually passing this call to server side, executing it and returning back the response to client side.

What SuiteScripts can do?
SuiteScript is considered as the most powerful tool for NetSuite’s customization.
NetSuite has 4 types of scripts Client, UserEvent, Schedule and Suitelet. There are other types as well but these will highlight most of the possibilities.
ClientScript allows you to show any alerts to display any message or other validity checks, just like JavaScript. But you can do advanced client stuff too. UserEventScript lets you modify the record; validate it, before it actually inserted to the

NetSuite database. ScheduleScript runs on server after every scheduled interval. It can be rescheduled programmatically. e.g.If any client wants to receive an email on every Monday morning consists of Sales Order details or When any record needs to be checked periodically for any new changes, for such cases ,ScheduleScript is the only solution. Suitelets can create custom page or forms. It can handle GET/POST requests. NetSuite provides library that helps you to create NetSuite looking page. You can also create HTML output. Resource Usage Limit-This is very interesting aspect of the NetSuite that I recently came across. Resource usage limit i.e. governance limit defined by NetSuite. NetSuite restricts resources usage per customer. SuiteScript thresholds are based on the volume of activity that a company’s user can generate.

In order to optimize application performance, NetSuite has implemented a SuiteScript governance Model based on usage limit. Usage units are tracked on two levels: the API level and the script type level. NetSuite has provided getRemainingUsage () API that you can use to see how many units you have remaining for a particular script. The work around for this is to break business logic in smaller parts. e.g. Sometimes there is requirement where you have to create multiple records through script and in half way script throws usage limit exceeded error if it exceeds governance limit for that script. For creating every record you call nlapiSubmitRecord () that consumes 20 units per call. To handle such cases you can do following check.

if( context.getRemainingUsage() >= 20) {
  //create record 
  NlapiSubmitRecord();
} else{ 
  //log message
  //return
}

Development Environment-
When you want to develop an app for NetSuite, you can get a testing development environment. Testing environment is almost a replica of production environment and fully functional. Whenever any script is developed and ready to run it can be uploaded to sandbox production server.?However there is no full proof guarantee that script developed in testing environment will give same expected output in production. Developer always ends up making changes in script in sandbox to achieve the expected result.

Challenges in NetSuite Development-
NetSuite gives developers the ability to extend NetSuite beyond the capabilities provided by point and click customization. But like many things in NetSuite, this comes at the trade-off of ease of use. NetSuite doesn’t provide you basic development framework that any platform offers:

1. No testing framework -NetSuite offers nothing of that sort and it is quite painful to find a bug especially when you have to deal with non-complied language like java script.

To make a change to your code, you have to upload a new version of file, to test every change. As NetSuite runs on cloud every time uploading a file takes a lot of time which in-turn increases whole development time.

2. NetSuite version upgrades -After every 6 months NetSuite releases new version of the production and testing environment. And 90% of the times, existing apps or services break down because of the changes in new version. NetSuite doesn’t provide any information about the kind of changes that are made or which records are unaltered. Developer has to test all the apps or scripts manually to ensure that none of the existing functionality breaks.

3. No track of code versioning-No ability to store application’s/scripts values. You can use SVN to keep track of the changes.

4. User experience -As no of scripts per record increases user experience for that record effectively decreases .If you have 10 UserEventScripts that must complete their execution before a record loads into the browser for the user, this significantly increases the time it takes for the record to load. As a consequence, the user’s experience working with the record is negatively affected.

5. NetSuite’s out-of-date documentation-When I first started my development in NetSuite I was actually banging my head against the wall .I kept getting completely brain-fried trying to figure out whether I should be looking at the docs or suite answers.

On plenty of occasions I have been caught out by outdated documentation. I think NetSuite kinda makes you believe that you learn better from your own mistakes! :) Now I have started to know my way around.

These are the four things I usually follow:

1.Decide a type of the script depending upon your requirement. You can select a type by looking at the APIs that are supported for every script type.

2.Refer the code snippet provided by the guide. NetSuite’s Ad-hoc Debugging Technique lets you debug code fragments written on the fly. Try debugging these code snippets before hand. ad-hoc debugging does not need any script deployment.

3.Refer to the schema browser and record browser provided by NetSuite .This guide helps you to understand the NetSuite’s terminology for every field of every record.

4.Use nlapiLogExceution() API . This is useful during the debugging of a script or for providing useful execution notes useful for tracking purposes. Summary-I would say in-spite of these challenges, NetSuite has made customizations possible and easy to some extent. Be ready to spend lot of time reading NetSuite documents and developing things from scratch. With some exceptions there are almost no limit to what can be customized in NetSuite and hence there is a pretty good chance to meet all your client requirements. I will continue sharing more specific experiences and nuances of on NetSuite as I explore and get to know more of it.

Summary: I would say in-spite of these challenges, NetSuite has made customization possible and easy to some extent. Be ready to spend lot of time reading NetSuite documents and developing things from scratch. With some exceptions there are almost no limit to what can be customized in NetSuite and hence there is a pretty good chance to meet all your client requirements. I will continue sharing more specific experiences and nuances of on NetSuite as I explore and get to know more of it.

Ketki Thosar