razer456
07/16/2021, 9:25 AMorg.mozilla.javascript.Undefined@30e8b3ba
i have got this response after successfully creating a record with restlet, what does it mean?CD
07/16/2021, 9:31 AMrazer456
07/16/2021, 9:31 AMCD
07/16/2021, 9:33 AMreturn
from the inline post
function, I thinkrazer456
07/16/2021, 9:34 AMRamanand Dubey
07/16/2021, 9:47 AM/**
* @NApiVersion 2.x
* @NScriptType restlet
*/
define(['N/record'], function (record) {
return {
post: function (restletBody) {
var restletData = restletBody.data;
for (var contact in restletData) {
var objRecord = record.create({
type: record.Type.CONTACT,
isDynamic: true
});
var contactData = restletData[contact];
for (var key in contactData) {
if (contactData.hasOwnProperty(key)) {
objRecord.setValue({
fieldId: key,
value: contactData[key]
});
}
}
var recordId = objRecord.save({
enableSourcing: false,
ignoreMandatoryFields: false
});
log.debug(recordId);
}
return recordId ? "Success" : "Failed";
}
}
});
Ramanand Dubey
07/16/2021, 9:48 AMrazer456
07/16/2021, 9:49 AM