Anybody can see what is wrong with this? I'm getti...
# suitescript
a
Anybody can see what is wrong with this? I'm getting the first property value with the value = undefined
j
Copy code
woIds[component.woid] = {data: ''};
woIds[component.woid] = {edata: ''};
after these two lines the object only has the edata property, so
Copy code
woIds[component.woid].data += '\r' + component.itemid;
is doing += on an undefined value
a
@jkabot You are 100% entirely my bad, did not see it...
j
you can simplify the whole thing by not duplicating the logic and having no if-else
Copy code
// initialize if not exist
woIds[component.woid] = woIds[component.woid] || { data: '', edata: ''};
... += ...
... += ...
if (component.taxo === '1') {
  ... += ...
}
a
Is ok now... after doing
j
👍
a
woIds[component.woid] = {data: ''};
woIds[component.woid].edata = '';
👍 1