ANS-1219 · SUITESCRIPT DEVELOPMENT
How to Access Item Pricing Information in NetSuite SuiteScript?
Understand how to retrieve item pricing details, including price levels and quantity breaks, from NetSuite item records using SuiteScript.
Short answer
Item pricing in NetSuite is found in currency-specific sublists, named `price` + `currencyId`. Fields include `pricelevel`, `pricelevelname`, `currency`, and `price_X_` for quantity pricing. Quantity thresholds are defined per currency, accessed via `price` + `currencyId` + `quantityX`.
Scenario
A NetSuite user or developer needs to programmatically access or modify item pricing information, including various price levels and quantity-based pricing tiers, directly from an item record using SuiteScript. Understanding the correct sublist names and field IDs is crucial for accurate data interaction.
Solution
To retrieve item pricing information from an item record in NetSuite SuiteScript, it is essential to understand the naming conventions for sublists and their associated fields. Item pricing sublists are dynamically named based on the currency's internal ID. Sublists are identified as price + currencyId (e.g., price1, price2, ..., priceX, where X is the Currency internal ID).Within these sublists, the following fields are available:pricelevel (internal ID of the price level)pricelevelname (text name of the price level)currency (internal ID of the currency)price_1_, price_2_, ..., price_x_ (representing each column for quantity pricing, where 1 is the first column with no quantity threshold).Quantity pricing fields are considered body fields and follow a specific naming pattern:price + currencyId + quantity1, price + currencyId + quantity2, ..., price + currencyId + quantityX.The number in quantityX represents each column for quantity pricing, with 1 always being the first column, which will have a value of 0.Quantity thresholds are defined per currency and are specific to each currency sublist, meaning fields like price2quantity1 or price3quantity1 are relevant for their respective currencies.For debugging and identifying specific field IDs, it is recommended to set some values on the item record and then append &xml=t to the URL in the browser. This will display the XML representation of the record, revealing the internal field IDs.Visual examples of field IDs:USD - sublistId: price + currencyIdQty 0 - fieldId: price + currencyId + quantity1Qty X - fieldId: price + currencyId + quantity2Qty Y - fieldId: price + currencyId + quantity3Price Level A - fieldId: pricelevel (id) or pricelevelname (text)fieldId: price_1_fieldId: price_2_fieldId: price_3_Price Level B - fieldId: pricelevel (id) or pricelevelname (text)
Expert NetSuite Support
Need help with this NetSuite issue?
SuiteScript Development consulting and configuration support
