Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

referencing by record # in a found set

Featured Replies

Here is the problem I am having, lets say I have a database with 6 records, and in those records is a field called "Status". Now lets say the first 4 records have the "Status" field set to "done" and the last 2 have it set at "Active".

Now, if I do the following (show every record whose field "Status" = "Active"), it will give me a found set with just the last 2 records. But if I then try to loop thru these 2 records and extract info this way:

repeat with i from 1 to 2

set New_Client to field "Customer_info" of record i

end repeat

I will get the value from the records with the value "done", since the (record i) reference is to the whole database not the found set. How do I loop thru only the found set records?

Now I realize I could just extract all values of the "Status" field into a list using: set New_Client_List to ((field "Customer_info" of every record whose field "Status" = "Active") as list)

But for reasons too long to explain here, I really need to be able to pull out values from a record in the found set by a sequencial reference.

Anybody know the syntax for that?

Manuel

Edited by Guest

repeat with i from 1 to 2

set New_Client to field "Customer_info" of record i

end repeat

Either do you loop thru the set with "Cell", or you write to "Field" which is the entire column if seen in table view and if you write "document" instead of "database" is it the found set. (seems to me it's a repetition from yesterday) You can compare the two form as Set Field or Replace in native scripting. Replace is the shotgun, while Set Field is a riffle. So a reply must be:

Beyond that do I not see a particular need for substituting native methods in applescript, and have a general hunch telling me that scripting might be a remedy for a pooly relational structured solution. Reserve the applescript use for porting data in and out of filemaker ... where it can be second to none - but for the inner mechanics is it not worth it.

--sd

set myCount to count of records

repeat with i from 1 to myCount

set cell 2 of record i to "bb"

end repeat





But the same thing could be written this way:




set field 2 to "bb"
  • Author

I'm using applescript because I need the database to interact with the underlying OS X Server's LDAP. I do some of that interaction with scodigo's smartpill but some of it I do in applescript, such as creating users and groups.

Manuel

That should be all right then, hence the word porting!

--sd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.