Hi all, {"type":"error.SuiteScriptError","name":"U...
# suitescript
s
Hi all, {"type":"error.SuiteScriptError","name":"USER_ERROR","message":"Please enter value(s) for: Name","stack":["anonymous(N/serverRecordService)","createtionofEnrollPaymentRecord(/SuiteScripts/CreationofEnrollPaymentRecord_SL.js:35)"],"cause":{"type":"internal error","code":"USER_ERROR","details":"Please enter value(s) for: Name","userEvent":null,"stackTrace":["anonymous(N/serverRecordService)","createtionofEnrollPaymentRecord(/SuiteScripts/CreationofEnrollPaymentRecord_SL.js:35)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}. I'm getting this error while creation of a custom record, Please anyone helps me. Thanks In Advance.
b
thats the error you get when you havent set a mandatory field
in this case the name field
s
in my custom record, mandatory fields are not there.
b
what does your custom record look like
s
message has been deleted
b
that does look like a record without the name field
what does your code look like
s
var paymentname = context.request.parameters.paymentname; log.debug('paymentname',paymentname); var studentname = context.request.parameters.studentname; log.debug('studentname',studentname); var cust_name = context.request.parameters.cust_name; log.debug('cust_name',cust_name); var enroll_rec = record.create({ type : "customrecordtype", isDynamic : true }); enroll_rec.setValue({ fieldId: 'custrecord_enrolled_parent_id', value:cust_name }); enroll_rec.setValue({ fieldId: 'custrecord_enrolled_student_id', value:studentname }); enroll_rec.setValue({ fieldId: 'custrecord_selected_payment_method', value:paymentname }); var enroll_recID = enroll_rec.save({ enableSourcing : false, ignoreMandatoryFields : false }); log.debug("enroll_recID",enroll_recID); context.response.write(JSON.stringify(enroll_recID)); } }
b
that does look normal
s
yes
b
id double check that the custom record type record doesnt set the
Include Name Field
field
s
record id is set to the name field also.
b
you can try changing enableSourcing or ignoreMandatoryFields
i would only expect ignoreMandatoryFields to have an effect