Posts

Calling User Event Script from another User Event

Image
As a netsuite solution provider User event scripts are executed on the NetSuite server. They are executed when users perform certain actions on records, such as create, load, update, copy, delete, or submit. Most standard NetSuite records and custom record types support user event scripts. The Most important thing is User event scripts cannot be executed by other user event scripts or by workflows with a Context of User Event Script. In other words for netsuite customizatio n, you cannot chain user event scripts. You can execute a user event script from a call within a scheduled script, a portlet script, or a Suitelet. I will help you to show how User event can be called from another User event Script using Suitelet. As we all know we cannot chain User event. Work around to this is to create a Suitelet that has the same logic as that of first User Event Script. Consider the use case given below: In NetSuite Implementation Create or edit an Inbound Shipment record and upon s

Understand Core Technology behind SuiteScript 2.0

As a netsuite solution provider we want to share, The core of  SuiteScript 2.0 came from the RequireJs and CommonJs background. RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environment. Using a modular script loader like RequireJS will improve the speed and quality of your code. Commonjs  defines a module format. Unfortunately, it was defined without giving browsers equal footing to other JavaScript environments. Because of that, there are CommonJS specification proposals for Transport formats and an asynchronous require. In NetSuite Customization and netsuite implementation    RequireJS tries to keep with the spirit of CommonJS, with using string names to refer to dependencies, and to avoid modules defining global objects, but still allow coding a module format that works well natively in the browser. RequireJS implements the Asynchronous Module Definition (formerly Transport/C) proposal. D

Understanding SuiteScript 2.0

As a NetSuite solution provider we want to share that netsuite is expanding its footprints very rapidly with new and latest technology implementation in the backend and frontend to improve the user experience. Netsuite Implementation partner and netsuite solution provider needs to take care of some important things about the technology which NetSuite is using, as after the release of SuiteScrip 2.0 NetSuite is more flexible and customizable. Following are some of the things we need to understand before going deep into netsuite customization suitescript 2.0: 1) Why SuiteScript 2.0? Optimized performance, Code in modular structure which is easy to debug in modules and enhance the functionality with performance. Using a modular script loader like RequireJS will improve the speed and quality of your code. 2) Is SuiteScript 1.0 sufficient? The SuiteScript 1.0 is based on native JavaScript but it is not able to utilize the benefits of new libraries and framework which a

FEW UPCOMING FEATURES IN NETSUITE

Image
There was amazing showcase of latest features as a Netsuite solution provider we saw in  #Suiteworld 2019.  The combination of Artificial intelligence, robotics, process automation NetSuite again stands out of the legacy things with the innovative model of next generation netsuite implementation . Page Builder : The page builder gives easy to use and capability to create netsuite customization UI by drag and drop ability it’s similar to content management system. Page builder gives strength to functional folks as they don’t have to dependent on technical guys for all the small stuffs. With page builder you can select the feature or filed of functionality which you want to use and just drag and drop in the layout area. you can select the layout as different layouts may come in future. You can select any of the layout from the above and use as per requirement. In the below screenshot you can see how simple is to create fields in the survey template. De

How To Overcome Script Execution Time Exceeded Error in Schedule script 2.0?

The disadvantage of scheduled suitescript 2.0 is that yield script functionality which is there in 1.0 has been taken away. Yield script had a great advantage of being able to resume the script from the point it stopped when time or usage limit exceeded. As netsuite solution provider we provide a Workaround in schedule script 2.0 to overcome time exceeded error is to monitor the time taken to process the script. inIf it reaches near the time limit of 3600s after which script errors out, schedule script can be called again by netsuite customization passing the point at which it needs to resume. For eg: if you are processing 100k records and script is able to process only 50k after 55 mins, then script can be rescheduled by passing the internalid of record from which script needs to process. This internalid is passed in the script parameter. Example code: var startTime = new Date().getTime(); for(var i=0;i<search.length;i++) { var endTime = new Date().getTime();

HOW TO SET SUBLIST SUB RECORD VALUES IN SUITE SCRIPT 1.0 AND 2.0

Subrecord values are retrieved and set in different ways in 1.0 and 2.0. Below examples can be used to understand the difference. Code example for setting Sublist subrecord in 1.0.  Note some variable have not been defined. Define them as per your accounts requirements                       var load_inv = nlapiCreateRecord('inventoryadjustment', {recordmode: 'dynamic'}); load_inv.setFieldValue('account', '1019'); load_inv.setFieldValue('adjlocation', 106); load_inv.setFieldText('custbody_cp_transaction', 'Coating zero parent '); load_inv.setFieldValue('custbody_c_from', recid); load_inv.selectNewLineItem('inventory'); load_inv.setCurrentLineItemValue('inventory', 'item', invadjitm); load_inv.setCurrentLineItemValue('inventory', 'location', 106); load_inv.setCurrentLineItemValue('inventory', 'adjustqtyby', 1); var su

HOW TO SOURCE A FIELD VALUE USING SAVED SEARCH?

Image
Values of fields can be sourced dynamically from saved searches. Search result should have only one column in the result and it should have summary. For eg: If you want to source customer's latest sales order date in an custom entity field created for customer record, you can create the search and field as given below: 1) Create a customer search- Make the search public      Criteria: Transaction Type Fields-> Type any of Sales Order           Results: Transaction Type Fields-> Date. Summary type->Maximum and sort the result by the field added in result  Under Available filter tab: Add internal id 2)   Create a Entity Field: Uncheck the store value checkbox. Apply to customer. Under Validation   and defaulting tab, under the saved search selection field, add the search created above                                                                                                                             Save and Apply to fo