```var percentual = parseFloat(search.lookupFields...
# suitescript
s
Copy code
var percentual = parseFloat(search.lookupFields({
                        type: 'customrecord_rsc_desconto_forma_de_parce',
                        id: currentRecord.getValue({ fieldId: 'custbody_rsc_forma_pg_st' }),
                        columns: ['custrecord_rsc_desconto_aplicado']
                    }).custrecord_rsc_desconto_aplicado) / 100
{"type":"error.SuiteScriptError","name":"SSS_MISSING_REQD_ARGUMENT","message":"search.lookupFields: Falta um argumento necessário: id","stack":["createError(N/error)","beforeLoad(/SuiteScripts/rsc/user event/rsc_eventuser_parcelamento_invoice.js:47)","createError(N/error)"],"cause":{"name":"SSS_MISSING_REQD_ARGUMENT","message":"search.lookupFields: Falta um argumento necessário: id"},"id":"","notifyOff":false,"userFacing":true} I'm having this problem. But I did not understand. I assume I must pass only the field ID.
c
currentRecord.getValue({ fieldId: 'custbody_rsc_forma_pg_st' })
<-- log that value
👍 1
r
typeof is helpful.
👍 1
n
the error indicates that the value you are passing as the id parameter is empty and the id is required to lookup the record
👍 1
s
Thank you guys. I will try to follow the suggestions