• 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: FMPro create request
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FMPro create request


  • Subject: Re: FMPro create request
  • From: "Daniel A. Shockley" <email@hidden>
  • Date: Tue, 23 Apr 2002 12:06:18 -0400

Quick answer: to put data in a new record, there are two methods:

1. Create a record, setting a variable to the result, which is the record's ID. Then, set the fields individually, one at a time.

2. Create a record at a specific layout, with the fields in a specific order (reads top to bottom, only across if two fields are at exact same vertical position). That way, you can use 'with data {item1, item2, etc}' where you put the list items in the same order as the fields.

So, you could make a layout called "script layout" in a database called "People.FP3". The layout has three fields: First Name, Last Name, and Occupation.

Here's how you could create a record using 'with data'

property specialLayout: "script layout"
property databaseName: "People.FP3"

set newRecordValues to {"Daniel", "Shockley", "AppleScript Programmer"}

set newRecordID to create new record at layout specialLayout [NO BREAK]
of database databaseName with data newRecordValues


If you want to do this without specifying a layout, you have to include every field in the database in your list, in the order they were created (I believe - I never do it that way).

Quick FMP question: how do I specify a field?

I want to do a find for records where the value in the field "Region"
is "West".

delete every request
create request with data {"West"}
find

but this only works if the first field is "Region". Is there any way
to specify which field you want to look at?

--
----
Daniel A. Shockley
email@hidden
email@hidden
http://www.danshockley.com
_______________________________________________
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.

  • Prev by Date: Re: Alias list not a list of aliases !?!
  • Next by Date: Re: Scripting non-scriptable apps
  • Previous by thread: FMPro create request
  • Next by thread: Command line parameters
  • Index(es):
    • Date
    • Thread