Link to home
Start Free TrialLog in
Avatar of butterhook
butterhookFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I use a global field to store a field property?

I'm sure I haven't used the correct terminology in my question, but I have recently been introduced to the global field within filemaker pro as the 'query' substitute for access. But I'm having trouble trying to understand how it works. To describe:

I have a supplier who supplies a changing source of seasonal vegetables. I have created a suppliers table which holds all the relevant suppliers details and also a produce table which stores the details for each vegetable these suppliers supply. In this produce table there is a produce id, a produce name, a unit cost (often changing and in need of updating) and a list value (yes or no) that states whether a vegetable is in season or not.

What I want is to be able to see within the suppliers record a list of vegetables they provide that are in season, and another list of vegetables they supply that are not yet in season. When a vegetable then becomes in season I want to be able to click a button labelled 'in season' and the vegetable then populates the 'in season vegetable list'. Likewise when a vegetable moves out of season, I want to press a button labelled 'out of season' and the vegetable populates the 'out of season vegetable list'.

These lists I want to view as tabs within the suppliers record.

I have previously been shown a method of doing something very similar using the global field within filemaker but though I have tried to emulate it as a solution to this problem I simply can't get it to work! Is there anyone who can help...(Lesouef you out there?)
Avatar of Bradley Haynes
Bradley Haynes
Flag of United States of America image

Why not write a Proc that test for the date and list items using "if" and the Date functions in FileMaker Pro
Avatar of Member_2_908359
yes, I am around, busy outside most of the day at the moment.
the example I gave you is exactly that. it's a bit late today (actually rather soon too-morrow!) to think properly, but I think by just renaming fields in my existing example, it should be clear enough.
can you remind me the name of the file I posted for you? Can remember it...
Avatar of butterhook

ASKER

Morning all!

Lesouef, the name of the file you posted was 'orders'
And b Haynes, what is a Proc?
I guess procedure = method = script in the filemaker world
Again, perfect Lesouef. The only problem I'm having now is adding this to my existing database. It doesn't seem to work after I rename the tables/files to correspond with suppliers and produce in the main database... what would be great is step by step adding exactly what you've done to my existing database. This way I can begin to understand exactly how these globals work, so that next time I don't have to bore you with the same question. Instead I can ask a different question (because there's loads of them!)

Is it possible to do this step by step? I'll do the first couple of steps:

1. Create a suppliers and produce table with the relevant fields within - DONE
2. Create relationships between these two tables - DONE (assuming it's exactly the same principle as before)

This is where I need you to take over:

3. ???

I've upped the point value to 500.

Cheers Lesouef
- create the startup script (or append to the existing one) to define the global fields when opening the files. (does not matter in local usage since they are saved, but in a multi-user environment on a server, they must be defined)
- create the new-order script or append to yours?
- create the script to alter the status, assign to the button in the in season portal.

and if all this fails, give a copy of yr file if not confidential.

I'll won't follow up this afternoon, I'll be offline.
Lesouef, I have done as you said, and it doesn't seem to work. Please have a look at this https://filedb.experts-exchange.com/incoming/ee-stuff/4889-Work-in-progress.zip then let me know where I went wrong...
ASKER CERTIFIED SOLUTION
Avatar of Member_2_908359
Member_2_908359
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I assumed seeing as though the database is stored locally and not for multi-users on a server, that I didn't have to define the globals... as you can see I'm really not clued into this global field psyche! I can't seem to understand it: access queries have a logic I;m able to understand. But I can't yet get my head around the global! Anyway, thanks again Lesouef! Was it just the globals that I failed to do properly?

How come there was no start up script for the customers and orders you originally did?
because I entered them manually, and as the file was local, it was stored.
in the second file, I thought it was better to use it the way you should do for shared files, but if you're sure it will never be on a server, you can define them once manually and forget about them. still safer to do it as the 2nd file as you never know how the file will be used in a 3 years time.
As for the globals, I know too few things about access to compare; I think you would not need such a trick in Access, since you can associate a query result to a layout. what else can I say? a global field is a field of which the value is common to all fields. it works like a global variable in javascript or php, but is stored in a field.
Well, once again, it's been a pleasure to work with you Lesouef. Perhaps next time we talk, I will have a better understanding of globals! Until then...
outside this topic, what's the reason for such a pseudo, butterhook?
Live and let Die: more specifically it is Julius W. Harris as Kanangas gleeful giant henchman Tee Hee, who uses a hook for a hand, with often deadly results. In a memorable scene he has Bond locked into a chair and threatens to snip off 007s fingers. When he fumbles a bit, Moore gets off one of his better wisecracks by muttering "butterhook".
thanks for culture minute!