AnsweredAssumed Answered

Two Level Scripted Find

Question asked by MattLeach on Mar 26, 2012
Latest reply on Mar 26, 2012 by MattLeach

I have a database with two related tables. I would like to script a find, using a field from each table in order to do an export

 

 

I have a clients table and an email table. This setup allows each record to have multiple email addresses. Each email address has a status field which is set to either Yes or No. The purpose of this field is to determine whether or not to include this address in an export.

 

There is a portal in the client table that lists all related email addresses.

 

The purpose of the script is to export all email addresses marked "yes" where the client's swpd2 date is greater than today.

 

I'm able to script the first find without issue, it's just getting the second part of the find where i'm having trouble.

 

 

New Window [Name: "Client"; Left: 2000] //reason for new window is that script is being initiated from un-related table
 Go to Layout ["TechSupport" (TechSupport)]
 Enter Find Mode []
 Set Field [TechSupport::swpd2; ">" & Get ( CurrentDate )]
 Perform Find[]
 Enter Find Mode []
 Set Field [Email::Status; "Yes"]
 Contrain Found Set []
 Export Records [parameters]

 

This script works in that it shows only clients who's paid 2 date is greater than today and shows emails with "yes" as status, but emails listed as "no" are also included. Not sure how to omit those during the script.

 

Any help would be appreciated.

 

Thanks

Outcomes