Error using Index in script - but only with mail creating

Hi.

We have a problem when using the index of a detailed records in a script, to check if there should be a line or not after each detailed line.

In print(pdf), web and designer everything is ok, but in when the email is received the line is there for each line after the first line was in the “if” was made to the detailed lines. Is that a know issue, or am I doing something wrong ?

Code:
var ItemDetails = record.tables.detailedPickup[index];
var RecordCount = record.tables.detailedPickup.length;
RecordCount–;
if (RecordCount > 0 && ItemDetails.index < RecordCount) {
Here the code is for the line}

I know that this is just a snippet of my template, but someone might have seen this problem before.

I will fix it manually, by adding a record number to each detailed record in the datamapper, and use that instead of the index, but that’s just a quick fix.

Thanks in advance.

PS: This is on version 1.3.1 (The Customer is going to upgrade in October)

Jacob

I would first try with latest version or with soon coming version 1.7 which got a lot of fixes, version 1.3 is quite old.

Hi Martin.

Sorry for my late answer, but the website had problems with login.

I did try it with version 1.6.1, but that was the same result. Version 1.7 is still not released, but of cause I will test it as soon as it is released.

/Jacob