VoidState Posted April 11, 2002 Share Posted April 11, 2002 Don't know if the title explains very well what I'm trying to do... What I want is to omit all records except the first from each catagory. Catagories is a field and the possible values are a, b and c. These values are defined in a value list. I want to write a script which will only show the first record where 'a' is the catagory, the first where 'b' is the catagory and the first where 'c' is the catagory. I am trying to replace a function which is slowing down a Flash movie I have connected to this database with a server-side script within Filemaker but cannot work out how to compare two different records. In the flash function I have two loops, one within the other, that compares each record to every other record and discards duplicates. Does anyone know if it is even possible to do something like this with Filemaker 5.5? And if it is, any help would be very much appreciated. Thanks Link to comment Share on other sites More sharing options...
dj Posted April 11, 2002 Share Posted April 11, 2002 Hi there, here's how you can acheive this: create two global fields myCategoryList and globalRecID define relationship "categories" from myCategoryList to category and firstRecord as look-up from field RecID from relationship Categories. define relationship "onlyFirstOne" from globalRecID to RecordID ( if you don't have it than create it now) Create an layout with only one field on it: categories::firstRecord Create an script named findFirstOnes Freeze Window Set error capture [on] Set Field [globalRecID,""] Find All Go Layout [your one field layout] Copy All records Go To Layout [ layout with filed globalRecID on It] Paste[globalRecID,select] Go to Related record ["onlyFirstOne",show only related records] HTH dj Link to comment Share on other sites More sharing options...
Recommended Posts