Search code examples
netsuite

is there a way to only import price data on Netsuite


I need to have 400+ price levels on Netsuite, but for the life of me, I can't find a way to add them through imports. From what I've seen and tried, Netsuite only allows you to upload items that reference existing price levels but doesn't allow you to upload new ones. Does anyone know how this could be done?


Solution

  • Price levels are scriptable.

    Since this is just a one time job you could do this in a console window (inspect any editable standard record and find/show the console)

    You will likely run into a governance error running this on 400 names but just

    • note the last name successfully created
    • refresh the page you have open
    • delete the names lines down through the last successful one
    • re-run the script
    • repeat until they are all created.
    require(['N/record'], record=>{
        const names = [
            'Test Level 1' // use your whole list of names
            'Test Level 2', // etc
        ];
    
        names.forEach(n=>{
            try{
              const pr = record.create({type:'pricelevel'});
              pr.setValue({fieldId:'name', value:n});
        // make your array of names more complex to handle discounts etc. 
              //pr.setValue({fieldId:'discountpct', value:xx});
              pr.save();
              console.log('created', n);
            }catch(e){
              console.error(n, e);
            }
        });
        console.log('done');
    });