November 14, 200025 yr Newbies I am working in FMP 5 and need to create a script to Find records of all jobs, which have 5 or more separate records -- e.g., 00-1234 has 6 records, 00-0123 has only 2 records. I can create a value list from the Job Number field, but I am stuck as to how to select the first value, perform a Find, check status, set flag for the Find and then go on to the next value in the value list. Any help will be appreciated. I searched the ScriptMaker forum, but did not find exactly what I am facing. TIA
November 14, 200025 yr You say that job A has five records and job B has 2 records. Are jobs kept in one database and the records that jobs have kept in another database? If so, you can use the Count function to find out how many related records there are for a job. Count the Job ID field in the database with job records, and you'll get a number of records for a job. Chuck
November 15, 200025 yr If all records are in the same database, you can build a self relationship with JobID matching JobID. Call this relationship "Self by Job". Then create a calculated field: Job Count (calculation,number) = Count(Self by Job::JobID) Perform a find entering ">=5" into the Job Count field. This will be somewhat slow for a large file (it's an unindexed find because of the relationship) but should still be faster than a looping script. -bd
Create an account or sign in to comment