1 follower Follow

Undefined results for all of number field where index is greater than 0

Ok I wrote this to figure out the loan count (stored as a number field) of the most recent related record where the Type is MTM. 

The issue I am having seems to be that some and possibly all of the @All of MTM Loan Count results do not come up as seemingly numbers so the calculation which is a numerical calculation throws a "the script returned an undefined result" error. 

If I just call @All of MTM Loan Count[0] I get a good number but if I try @All of MTM Loan Count[1] or any number seemingly greater than 0 the result seems to be text not numerical despite MTM Loan Count being a number field. 

If I wanted text I can add a + " " or +"\n" and get a text result but I was going for a numerical result. 


Any thoughts?


var last = 0;
var count = 0;

for(i=0; i<@All of PAS Title.length;i++) {

if (@All of Type[i] == "MTM" )
last = count + 1;
count = count + 1;
} else {
count = count + 1;


@All of MTM Loan Count[1];

Joel Ordesky

Please sign in to leave a comment.