May 27, 200421 yr Scenario: I have a large found set of people I want to send a mailer to. Some have duplicate addresses, and I want to send only one mailer to a household. I sorted the set by address, so any records with duplicate addresses will be adjacent to each other. I want a script that will start on the first record and compare its address with the next record's address. If they match I want the script to mark a field "no" (they all start marked "yes"). If they do not match, I want it to move onto the next record and continue doing this to the end. Then I can ommit all the ones newly marked "no" and create the labels. Any help would be appreciated! -Phil
May 27, 200421 yr Go to Record/Request/Page [First] Set Field [gText, Address] Go to Record/Request/Page [Next] Loop If [Address = gText] Set Field [mark, "no"] Else Set Field [gText, Address] End If Go to Record/Request/Page [Exit after last, Next] End Loop Another option is to create a self-relationship from Address to Address and a calculated field of serial = selfrel::serial. Then you can perform a find for 1 in this calculated field to find unique records.
June 1, 200421 yr Author I am trying to follow your instructions but am hitting a wall. What is gtext? I do not see that anywhere in the scripting tools. E-mail directly if you want: [email protected] Thanks so much for your help!
June 1, 200421 yr There is another technique that you can use. You can view our method here: http://www.fmdeveloper.com/php/tips_and_tricks.php This one works a little quicker. But to answer your question, gtext is a global field that you define to make that one work
June 1, 200421 yr That's the other method I suggested. You don't need to specify a sort order by creation date, however, as FileMaker automatically assumes the first related record is the oldest if no sort order is specified. So it's redundant.
June 2, 200421 yr Author None of this worked for me, but thanks for your help. I am giving up and filtering out duplicates manually.
June 2, 200421 yr Sorry to hear that. If you attach a clone of your file, we could tweak it to show you how it works, if you like.
Create an account or sign in to comment