Discussions

Check out Oracle NetSuite upcoming events and conferences here
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Update your Profile with your Support type to get your Support Type badge.
Expand your NetSuite knowledge by joining our Ask A Guru Live sessions. RSVP on this event now.
Community Poll: What sort of content would you like to see more of?

How to execute suitescript 2.1 code in POSTMAN?

edited Jun 27, 2023 5:12PM in Ask A Guru 3 comments

Hi can anyone help me execute how to run a suitescript 2.1 code in POSTMAN below is sample code.


require(['N/record'], function(record){

  function createBomRevision(values, items){

    var rec = record.create({

      type: 'bomrevision', isDynamic: true

    });

    for (var key in values){

      if (values.hasOwnProperty(key)){

        rec.setValue({

          fieldId: key,

          value: values[key]

        });

      }

    }

    for (var itemIndex in items){

      rec.selectNewLine({

        sublistId: 'component'

      });

      for (var key in items[itemIndex]){

        if (items[itemIndex].hasOwnProperty(key)){

          rec.setCurrentSublistValue({

            sublistId: 'component',

            fieldId: key,

            value: items[itemIndex][key]

          });

        }

      }

      rec.commitLine({sublistId: 'component'});

    }

    return rec.save({enableSourcing: false, ignoreMandatoryFields: false});

  }


  var bomRevisionId = createBomRevision({

    'billofmaterials': 132,

    'name': 'BOM-TEST-REV1',

    'effectivestartdate': new Date('06/19/2023')

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!

Leaderboard

Community Whiz

Quarter 2 ((Apr-Jun 2024) )

This Week's Leaders

This Month's Leaders

All Time Leaders