```org.mozilla.javascript.Undefined@30e8b3ba``` i ...
# suitescript
r
Copy code
org.mozilla.javascript.Undefined@30e8b3ba
i have got this response after successfully creating a record with restlet, what does it mean?
1
c
Share your code
r
Untitled
c
You need a
return
from the inline
post
function, I think
r
i will try
r
Copy code
/**
 * @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";
        }
    }
});
try above code.
r
gotcha, thanks!