```var descTamanhoId = descTamanho[0].id var descT...
# suitescript
s
Copy code
var descTamanhoId = descTamanho[0].id
var descTamanhoPercent = descTamanho[0].getValue('custrecord_rsc_canal_cliente_desconto')
Why does it generate this warning? Property 'id' does not exist in type 'string'.ts (2339) Property 'getValue' does not exist in type 'string'.ts (2339) This happens in vscode
s
it looks like the type system trying to avoid a mistake. it suggests that the type of
descTamanho[0]
is a string, and indeed strings don't have
id
properties.
nor do strings have a
getValue()
method
you should probably share how
descTomanho
gets set
s
@stalbert Right! i will share
hey @stalbert,
descTamanho
it's set to empty string
s
ok, in that case the errors you're seeing are not a surprise, except that your array indexing into that variable should cause other errors. Are you sure you don't mean
descTamanho[0] = ''
?
s
@stalbert I will try to do it that way. This script is not mine, I'm having to fix some bugs. But thanks