Josie
06/14/2020, 12:42 AM400 Bad Request: This request is missing a required parameter.
Does anyone know what can wrong for upsert using suitescript 2.0? I passed the record type and id
function put(context) {
doValidation([context.recordtype, context.id], ['recordtype', 'id'], 'PUT');
var rec = record.load({
type: context.recordtype,
id: context.id
});
for (var fldName in context)
if (context.hasOwnProperty(fldName))
if (fldName !== 'recordtype' && fldName !== 'id')
rec.setValue(fldName, context[fldName]);
rec.save();
return JSON.stringify(rec);
}
battk
06/14/2020, 3:22 AMJosie
06/14/2020, 4:01 PMput
use requestBody instead of requestParams like get
, thanks @battk