September 29, 200619 yr I have a table with contact information for customers And i have a table for open service tickets. The fields are related by company. I have a button to send an email internally to announce the new ticket. I want the ticket to include the email addresses of all related contacts (related by company) Now I could use Count ( Contacts::EmailAddress) for an If statement, to determine if there are more than one contact records for that customer And i could use GetNthRecord ( Contacts::EmailAddress; 2) But what i want to know, is there any way to do a For Loop? Like For( TempVar; Start at 1; end at Count ( Contacts::EmailAddress); GetNthRecord ( Contacts::EmailAddress; TempVar) ) I know there is no for loop, but how can i do a conditional loop that doesn't force me to copy the same code over and over and change the numbers for each repetition It just seems so inefficient to me. Thanks in advance!
September 29, 200619 yr It would be really easy to do with the List function if you had FileMaker 8.5: List(Contacts::EmailAddress) If you want to use GetNthRecord, you'll need FileMaker Advanced to create a recursive custom function. GatherRecords (Field; Found) = Case( Found > 1; GetNthRecord(Field; Found) & "¶" & GatherRecords(Field; Found - 1); GetNthRecord(Field; 1) ) Once you have the recursive custom function, you can call it in a calculation using the following: GatherRecords (Contacts::EmailAddress; Count(Contacts::EmailAddress))
September 29, 200619 yr 1. Same as here. 2. You can also define a value list of e-mail addresses (only related values) and use ValueListItems() to get the values. Edited September 29, 200619 yr by Guest
Create an account or sign in to comment