CRRPE3022E The JavaScript expression could not be evaluated. TypeError: Cannot read property "value" from undefined (src1#19)
Hi team,
Currently I am using RPE to generate report for DNG module,
I am using the below java script:
if(arrayObject == '')
{
arrayObject = [];
}
var i = 0;
for( i = 0; i1 < arrayTitle.length; i++)
{
var tempObj = { title:'', value:''};
if( arrayTitle[i1] != prevTitle)
{
tempObj["title"] = arrayTitle[i1];
tempObj["value"] = arrayValue[i1];
arrayObject.push(tempObj);
}
else
{
arrayObject[i1-1].value = arrayObject[i1-1].value +', '+ arrayValue[i1];
}
prevTitle = arrayTitle[i1];
}
when I run the report template, it show error as below:
CRRPE3022E The JavaScript expression could not be evaluated.
TypeError: Cannot read property "value" from undefined (src1#19)
[Error context] Template is D:\Anh_Do\ALM\RPE\RPE_Module_detail_report_1.dta
[Error context] Template element is 90
[Error context] Expression is used for CODEBLOCK
I think I have declared array with every item is with type: var tempObj = { title:'', value:''}; so the property "value" for every item in array should be accessible. But the RPE tool keep give error like that.
Please help me on this,
Thank you,
Best regards,
Anh Do
One answer
I believe it complains about this line.
Basically your code references an undefined arrayObject[i1-1].arrayObject[i1-1].value = arrayObject[i1-1].value +', '+ arrayValue[i1];
Not sure whether the forum messed up your code - I cannot see where you set the value for i1 and when to change it. The code makes no sense to me.