Conditional - Based on detail table

Hello,

I have a detail table for each record. There is a field in the detail table called Revision which could either be blank or have a value of Revised. This particular record has 5 detail records and the 3rd record is indicated as Revised, which 1,2,4,5 are blank. I want a condition applied to a watermark that is set to show if any of the detail records are set as Revised. The condition below isn’t working (doesn’t set the condition to show the watermark) for me because I’m assuming that detail record 4 and 5 override the show().

results.each(function(index) {
var rfield, result = “”;

rfield = record.tables["G_Fields"][index].fields["Revision"];
if ((rfield !== "") || (record.fields["addr_override"] !== "")){
  results.show();
}
else{
  results.hide();
}

});

This has been fixed with:

var recordhasbeenrevised, i;

for (i = 0; i < record.tables.G_Fields.length;i++){
if ((record.tables.G_Fields[i].fields.Revision !== “”) || (record.fields.addr_override !==“”)){
results.show();
break;
}else{
results.hide();
}
}

You could as well have looped through all detail records and set a boolean variable to true or false. then use that variable to show or hide your watermark.