Hello everyone, how can I assign a "paymentoption"...
# general
a
Hello everyone, how can I assign a "paymentoption" in a "customerpayment" via script? i have this:
var objRecord3 = record.transform({
fromType: 'invoice',
fromId: invoiceIdP,
toType: 'customerpayment'
});
objRecord3.setValue({
fieldId: 'trandate',
value: defaultDate
});
objRecord3.setValue({
fieldId: 'paymentoption',
value: 15
});
var rid3 = objRecord3.save();
but obtain this error:
{"type":"error.SuiteScriptError","name":"INVALID_FLD_VALUE","message":"You have entered an Invalid Field Value 15 for the following field: paymentoption","id":"","stack":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at Object.onRequest (/SuiteScripts/DT-009 - /SD_SL_EmailPa.js:449:55)"],"cause":{"type":"internal error","code":"INVALID_FLD_VALUE","details":"You have entered an Invalid Field Value 15 for the following field: paymentoption","userEvent":null,"stackTrace":["Error\n at RecordInvoker.save (suitescript/resources/javascript/record/serverRecordService.js:371:13)\n at NetSuiteObject.thenableFunction() (suitescript/resources/javascript/record/proxy.js:115:24)\n at Object.onRequest (/SuiteScripts/DT-009 - Card/SD_SL_EmailPa.js:449:55)"],"notifyOff":false},"notifyOff":false,"userFacing":true}
f
Have you tried to create it manually using standard UI?