AnsweredAssumed Answered

Multiple Record If

Question asked by mrtinvan on May 22, 2018
Latest reply on May 22, 2018 by mrtinvan

I'm trying to get a script that will look at a table and send an email if a task is overdue by x number of days.

I've got a tasks table that has a few fields:


Task, Date Assigned, Assigned To, Days Waiting and Completed.

Date Assigned is auto generated from Creation Date

Assigned to is a pk relationship to a Technicians Table, which contains Name and Email.

Days Waiting is a Calculation (Get(CurrentDate)-Date Assigned)

Completed is a Check Box set with Yes or No.


The script is as follows:

New Window [Using Layout: Tasks}

Perform Find [Omit Records, Tasks::Completed [Yes]

If [Tasks::Days Waiting > "3"]

     Set Variable [$Tech Email; Value: Technicians::Email]

     Send Mail [To: $Tech Email]

End If


The Script works fine, and sends the correct number of emails, but all of the emails go to the email address in the first record.


How can I get the script to look at all the records and send the email to the correct Technician?