Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FileMaker Topics / February 2004

Tip: Looking for answers? Try searching our database.

Distinguishing global fields from nonglobal fields w/Appleevents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chap Harrison - 26 Feb 2004 23:43 GMT
An Applescript bulk loader I'm working learns all the field names and their
creation order in the database I'm loading, so that I can construct a valid
'Create Record' command.  Briefly,

The following command gets the names of all the fields in the DB (Filemaker
automatically defines layout 0 as "every field")

(1) set dbFieldNames to (get name of every field in layout 0 of database
theDB)

Iterating thru this list, I get the field i.d.  of each field.  Somewhere
it's documented that field ids are floats in ascending sequence by creation,
so I can use this to sort the fields into creation sequence.  The command to
get a field id is this:

(2) set dbID to (get ID of field dbFieldName in database theDB)

Using this sorted list I can construct a list of values (theValueList) that
can be passed to FMP as follows:

(3) create new record at end of database theDB with data theValueList

This has worked fine until I recently added a couple of global fields to the
DB.  Now, in step (1) dbFieldNames includes the names of those global
fields.  But if I construct an ordered list of values for every field in
dbFieldNames, and pass it in step (3) as theValueList, I get an "invalid
data" error from FMP.  There are now 15 "normal" fields and 2 global fields,
so I am passing a list of 17 values in the create-new-record, but FMP
(understandably) only wants 15.

Offhand I can't figure out how, in steps 1 or 2, to identify and ignore
global fields.  

Does anyone know how to ask FMP whether or not a field is global?

Thanks, Chap
S?ren Dyhr - 27 Feb 2004 06:37 GMT
> Offhand I can't figure out how, in steps 1 or 2, to identify and ignore
> global fields.  
>
> Does anyone know how to ask FMP whether or not a field is global?

You're writing to layout 0, but to avoid this do make a new layout
sans the globals and the setting via the iteration is then again 15
...

--sd
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.