There is a client script entry point called SublistChanged() and it will trigger on sublist change button action. Each trigger can be identified by using context.operation method.
Author: Vishnu P
Get contents from file more than 10MB
The module N/file can be used to fetch the details from the file. Normally we can fetch the content by file.getContent() property and have a 10 MB file size limitation. If we have more than 10 MB file can be iterated by line by line using file.lines.iterator() propety. File.lines.iterator() var iterator = invoiceFile.lines.iterator(); //Skip the… Continue reading Get contents from file more than 10MB
FedEx Authorization (Auth 2.0) API details
Authorization API Details This API allows you to authorize the API requests and it is required to authenticate the FedEx resources. The following section describes the prerequisites for the API: While registering to FedEx Developer portal, FedEx provides a combination of Client ID (API Key) and Client Secret (Secret Key) to authenticate API requests for… Continue reading FedEx Authorization (Auth 2.0) API details
Map/ Reduce Structure for high data
For example, if there are 5 files and each file has over 50000 lines. We need to process each line from the files for all 5 files. We need to create a script parameter for the map-reduce script with no default value or set the default value as the first file referring key value. In… Continue reading Map/ Reduce Structure for high data
Function to parse XML
The following sample parses the XML string stored in the xmlString variable. The sample selects all config elements in the XML document node, loops through them, and append their contents.
Function to throw Error in suite script
Use the N/error module to create your own custom SuiteScript errors. Use these custom errors in try-catch statements to abort script execution. This module does not provide the functionality to throw custom errors, however, your script can include logic to throw custom SuiteScript errors after they are created. Make sure that the throw function should… Continue reading Function to throw Error in suite script
Array Merge/ Combine in JS
Merge without removing duplicate elements -> Using concat() Method: The concat() method accepts arrays as arguments and returns the merged array. // with elements of nums1 and returns the // combined array – combinedSum arraylet combinedNums = nums1.concat(nums2, nums3);// More readable formlet combinedNums = [].concat(nums1, nums2, nums3); -> Using spread operator: Spread operator spreads the value of the array into… Continue reading Array Merge/ Combine in JS
Transform sales order to item fulfillment
For a sales order with committed line items can be converted by setting default value as inventory location. Kindly refer to the transform code below. let trecord = record.transform({ fromType: “salesorder”, fromId: salesOrderId, toType: “itemfulfillment”, defaultValues: { ‘inventorylocation’: locationInternalId } }); If the sales order is uncommitted and the feature “Allow uncommitted” is enabled in… Continue reading Transform sales order to item fulfillment
Sales order can be fulfilled if the item quantities were back ordered in the transaction
The sales order can be fulfilled if the item quantities were back ordered in the transaction by enabling the enable feature below. Under Setup > Accounting > Accounting Preference Click Order Management Fulfill Based On Commitment:Set to Ignore Commitment or Allow Uncommitted This Preference allows creation of Item Fulfillment on Sales Orders even when Items are back-ordered. The quantities in Sales Order will remain as back… Continue reading Sales order can be fulfilled if the item quantities were back ordered in the transaction
You cannot change the GL impact for intercompany inventory transfer lines
Updating an Intercompany sales order which is paired with an intercompany purchase order will throw the following error:You cannot change the GL impact for intercompany inventory transfer lines As of NetSuite standards, we couldn’t make a GL-impact change on the Intercompany Sales Order that was created from an Intercompany Purchase Order. Any modification made to… Continue reading You cannot change the GL impact for intercompany inventory transfer lines