Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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')