• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Iterating over a set of FMP records with Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iterating over a set of FMP records with Applescript


  • Subject: Re: Iterating over a set of FMP records with Applescript
  • From: Chap Harrison <email@hidden>
  • Date: Sat, 21 Feb 2004 15:28:11 -0600

This is a followup to my earlier post, in which I'm trying to find some records in a FMP database and iterate across them.

In line 3, I get a list of IDs of records in LineItems that fulfill some search criteria.

In line 4, I iterate over the ID list.

In line 5, I get "record 1 of all records with a particular ID" (the only record, one hopes), and I make that the current record. At this point I figure I should be able to get and set cells in the record.

Line 6 is there just so I can check out what's happening with the debugger.

Strangely, running this under Script Debugger, the RESULT after line 6 is the ID of a record in another database (called WebOrders)!! And consequently, step 7 dies with "Object not found" -- there is not a field called "InventoryCode" in WebOrders.

LineItems *does* have a relationship to WebOrders (there are many LineItem records for one WebOrder record). Does anyone understand how "current record" is suddenly getting pointed to a record in WebOrders?

1 try
2 tell application "FileMaker Pro"
3 set myIDList to ID of (every record of database gLineItemsDB whose cell "Price" is "*")
4 repeat with myID in myIDList
5 set current record to (record 1 of database gLineItemsDB whose ID is myID)
6 (current record) -- incredibly, current record now points into WebOrders.
7 set myBarf to cell "InventoryCode" of current record
8 display dialog myInvCode
9 end repeat
10 end tell
11 on error myMsg
12 display dialog myMsg
13 end try
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Iterating over a set of FMP records with Applescript
      • From: Walter Ian Kaye <email@hidden>
References: 
 >Iterating over a set of FMP records with Applescript (From: Chap Harrison <email@hidden>)

  • Prev by Date: Re: Assigning Scripts to "Hot Keys"
  • Next by Date: Re: How to rename a project builder project?
  • Previous by thread: Iterating over a set of FMP records with Applescript
  • Next by thread: Re: Iterating over a set of FMP records with Applescript
  • Index(es):
    • Date
    • Thread