Here is setting the “Base Price level” value as zero in the inventory item record.
Note : The line number may varies according to the price level list order.
/**
/**
* @NApiVersion 2.1
* @NScriptType MassUpdateScript
*/
define(['N/record', 'N/search'],
/**
* @param{record} record
* @param{search} search
*/
(record, search) => {
/**
* Defines the Mass Update trigger point.
* @param {Object} params
* @param {string} params.type - Record type of the record being processed
* @param {number} params.id - ID of the record being processed
* @since 2016.1
*/
const each = (params) => {
var objRecord = record.load({
type: record.Type.INVENTORY_ITEM,
id: params.id,
isDynamic: true,
});
objRecord.selectLine({ //selects the base price level
sublistId: 'price',
line: 0
});
objRecord.setCurrentSublistValue({
sublistId: 'price',
fieldId: 'price_1_',
value: 0
});
objRecord.commitLine({
sublistId: 'price'
});
objRecord.save();
}
return {each}
});