Discussions
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Join us
How to execute suitescript 2.1 code in POSTMAN?
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')