This topic contains 2 replies, has 0 voices, and was last updated by michoel 5 years, 11 months ago.

  • Author
    Posts
  • #17796 Score: 0

    MChammaTX
    • Contributions: 0
    • Level 1

    Not sure what i’m doing wrong but the following doesn’t work for me. It saves without error but the base price is not updated.:

    Code:
    require([‘N/record’],function(record){

    var itemrec = record.load({type:’inventoryitem’,id:18509,isDynamic:true})
    itemrec.selectLine({sublistId:’price1′,line:0})
    itemrec.setCurrentSublistValue({sublistId:’price1′,fieldId:’price’,value:’1.00′})
    itemrec.commitLine({sublistId:’price1′})
    itemrec.save();
    });
    This is a cached copy. Click here to see the original post.

  • #17797 Score: 0

    JohnCCole
    • Contributions: 0
    • Level 1

    Have you done an old fashion record load from the browser console on the client side and looked at the record. Looks like the price field could actually be price_1_ if you have tiered pricing you’d have price_2_ price_3_ for every tier that has a value.

  • #17798 Score: 0

    michoel
    • Contributions: 0
    • Level 1

    Changing pricing via script will be different depending on which pricing features you have enabled in your account (Multiple Currencies / Multiple Prices / Quantity Pricing)

    https://system.na2.netsuite.com/app/…502207768.html

    Try this if you have all three features active

    Code:
    recordObj.selectLine({ sublistId: ‘price1’, line: 0 });
    recordObj.setCurrentMatrixSublistValue({ sublistId: ‘price1’, fieldId: ‘price’, column: 0, value: ‘1.00’ });
    recordObj.commitLine({ sublistId: ‘price1’ });

You must be logged in to reply to this topic.