Fetching the Shipping rate from the multiple UPS accounts using the UPS API Integration

A script was developed for populating package dimensions and fetching the shipping rates from the different UPS accounts   The script will work only on the sales order create. The custom button called “Calculate Shipping Rate” was added in the Sales order edit context. While clicking the button the shipping rates will be fetched from the… Continue reading Fetching the Shipping rate from the multiple UPS accounts using the UPS API Integration

Shipping Addressee getValue in Sales order

Scenario The Shipping adressee value is null when getting the field value of the ship addressee in a sales order. var addressee = nlapiGetFieldValue(‘shipaddressee’); Solution The recommended way of getting the ship addressee in the sales order is by accessing the subrecord of shipping address field. nlapiViewSubrecord(‘shippingaddress’) The line above will return the address subrecord which… Continue reading Shipping Addressee getValue in Sales order

Setting Field Values Using the Date JavaScript Object

Scenario A developer uses the JavaScript Object new Date() when setting date field values via SuiteScript and is uncertain of the timezone being used by the API. Solution The date and time that is set to fields accepting new Date() varies depending on the current timezone set on the local computer it is running on. So in order to… Continue reading Setting Field Values Using the Date JavaScript Object

Allocating Supply to Order Demand

To manually allocate supply to orders: Go to Transaction > Order Management > Allocate Orders. To refine your order allocation results, complete the optional Order Filters section.For more information, see To complete the order filters section: In the Sorting Options section, you can optionally sort the order list.The sorting options default is based on your set… Continue reading Allocating Supply to Order Demand

Map Reduce Script

Map/Reduce script is an alternative to a scheduled script which can handle/process a large amount of data. It is best suited for scenarios where data can be divided into small and independent parts. When the script is executed, a structured framework automatically created enough jobs to process all of these parts. No need to manage… Continue reading Map Reduce Script

Date format using moment.js

MomentJS is a JavaScript library which helps in parsing, validating, manipulating and displaying date/time in JavaScript. Its parsing allows you to parse the date in the format required. Parsing of date is available in the string, object and array. You can use the method isValid() and check whether the date is valid or not. MomentJS also provides… Continue reading Date format using moment.js

Java Script – encodeURI() & decodeURI()

encodeURI():This function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character. It returns a new string representing the provided string encoded as a URI. This method does not encode characters like: , / ? : @ & = + $ * #Use the encodeURIComponent() method instead. decodeURI():This function… Continue reading Java Script – encodeURI() & decodeURI()

Resolve Script Error:” Invalid custbody_xxx Reference Key xxx When Setting the Field Value of a List/Record Custom Field”

Error is thrown when the value that the user is trying to set cannot be found among the IDs collection of that record or the field to set has a different type than the value to set to. Solution For example: Sales Order is generated from Case record using script. A custom field Linked Case… Continue reading Resolve Script Error:” Invalid custbody_xxx Reference Key xxx When Setting the Field Value of a List/Record Custom Field”

Workflow Did Not Execute as Admin

Scenario A workflow has been set to execute as Administrator. Upon switching to a custom role, the workflow did not execute the actions as expected. Example: Set value on a custom field upon click on a button. Solution An action that is triggered by a button will be recognized as a Client Side trigger. As a result,… Continue reading Workflow Did Not Execute as Admin

Void Transactions using N/transaction Module

Load the transaction module to void transactions. When you void a transaction, the total and all the line items for the transaction are set to zero. The transaction is not removed from the system. NetSuite supports two types of voids: direct voids and voids by reversing journal. The type of void performed with your script… Continue reading Void Transactions using N/transaction Module