Item Price List Update

Jira Code: MISC-310

Script sample in NetSuite Debugger for fetching and updating Item Price List of Inventory Item

require(['N/record', 'N/log'], test);

function test(record, log) {
    //REFER https://netsuite.custhelp.com/app/answers/detail/a_id/65763/kw/65763
    var itemRecord = record.load({
        type: 'lotnumberedinventoryitem',
        id: '1119',
        isDynamic: false
    });
    //List Price for Base Price when multicurrency is enabled
    for (var column = 0; column < 5; column++) {
        log.debug('getMatrixSublistValue QTYBreak', itemRecord.getMatrixSublistValue({
            sublistId: 'price1',
            fieldId: 'price',
            column: column,
            line: 0
        }));
    }
    //Update Price
    for (var column = 0; column < 5; column++) {
        itemRecord.setMatrixSublistValue({
            sublistId: 'price1',
            fieldId: 'price',
            column: column,
            line: 0,
            value: (10 * column) + 50
        });
    }
    itemRecord.save({
        enableSourcing: false,
        ignoreMandatoryFields: true
    });

}

Leave a comment

Your email address will not be published. Required fields are marked *