Hi all,
My company has multiple product lines with various pricing structures that requires us to have a long list of Price Levels on our items in NetSuite. We had a 3rd party write a script that updates some of these price levels prior to me being hired. This script sets the pricing using the function item.setLineItemMatrixValue() (See snippet of Screen Shot below):
[ATTACH=CONFIG]n347539[/ATTACH] [ATTACH=CONFIG]n347609[/ATTACH]if(item!=null){
nlapiLogExecution('DEBUG', 'UpdatePricing',
'Updating Price Level for item id: ' + updateableItem.getId());
item.setLineItemMatrixValue('price1', 'price', 40, 1, DISCOUNT4060);
item.setLineItemMatrixValue('price1', 'price', 41, 1, DISCOUNT4555);
item.setLineItemMatrixValue('price1', 'price', 42, 1, DISCOUNT5050);
item.setFieldValue('custitem_Discount_Price_Update d', 'F');
nlapiSubmitRecord(item);
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This code sets the pricing fine, but is inefficient because it sets the price based on the column matrix index of the discount price. This means that as we add new products and subsequently new price-levels, I have to be careful that these new price level names don't fall alphabetically before the discounts above or I will be updating the Matrix values of the above script regularly.
Is there a way to set the price level based on the Internal ID of the price level itself instead? If so, this would alleviate my issues described above.
Thanks in advance for any help!