AnsweredAssumed Answered

Perform script on all records

Question asked by cristian.stanimir on Apr 11, 2018
Latest reply on Apr 11, 2018 by beverly

Hello again,

 

So I have this problem -trying to figure it out for about 5 hours now.

I have 2 related tables.

DATA (PKClientID) and Auctions (FKClientID) -- one to many - with allow creation of records in Auctions.

On the Auctions table I have 2 main fields  date and comments  and a few calculated fields that return a message based on the auction date and the current date ( ex: 2 days till auction, auction has expired, auction is today )

I am trying to set up a script that will check all the clients from the DATA table and the related records from Auctions table and ignore clients that don't have and auctions added, for clients that have auctions added send a email notification.

I'm currently trying the loop script but it only checks one record -  the one active.- and sends an infinite number of emails for that client only.- if I don't stop it.

The script will be running on a schedule in FM Server.

 

Go to Layout [ “Overview” (Data_Input) ]

Loop

Go to Record/Request/Page

[ First ]

If [ not IsEmpty ( Auctions::date ) ]

Go to Related Record [ From table: “Auctions”; Using layout: “Auctions” (Auctions) ]

[ Show only related records; Match found set ]

Sort Records by Field [ Ascending; Auctions::date ]

Go to Record/Request/Page

[ Last ]

Send Mail (email options etc)

Else

Go to Record/Request/Page

[ Next; Exit after last ]

End If

End Loop

 

Thank you for your support.

Outcomes