• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 323
  • Last Modified:

is it possible to set a database global

is it possible in filemaker pro8 to set a global value that can be seen no matter what layout you are in???
0
kauakea
Asked:
kauakea
  • 6
  • 5
  • 2
2 Solutions
 
lesouefCommented:
yes, just place the table:field in any layout. if the field is global, it will be always true whatever record is active, so you don't even need a relationship in between the table containing the global field and the table linked to the layout.
0
 
billmercerCommented:
One warning about global fields. If you're connecting to a remotely hosted database (not opening it directly yourself) then the value of a global field is not preserved when you exit the application. Each time you open the file, the gloaIt gets reset back to whatever the value was when the file was last opened locally. This can be confusing if you don't understand it.

(For what it's worth, you can also create a global script variable by using two $ in front of the name instead of one.)

0
 
kauakeaAuthor Commented:
would using a global script variable be safer?? i do have multiple users. i am using fm8 in share mode.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
lesouefCommented:
it's the same, you have to define its value at startup. it just that it does not waste a field, but you can't place it in a layout, so you'll have to use a global field for this anyway. if you're to keep a lot of parameters this way, and users may need to alter them, you'd better use a table for parameters and make a loop through all its records at startup to define the variables.
0
 
kauakeaAuthor Commented:
i have 3 tables. when i create a record in one table i want to use a custom dialog to get the primary field and then setting a global value and then use the set command to create new records in the other 2 tables via etting the primary field in the other 2 tables with the global value.
0
 
lesouefCommented:
so, why do you use a custom dialog? to confirm records creation?
are these tables related? if yes, just enable records creation though the relationship and create a new line in a portal for instance.
if not, just create a nex record in 1st table, save the ID as $id for instance, goto 2nd table/layout, new record, set field 2ndtable::id=$id, etc...
no need for questions or defining any startup value.
am I missing something?
0
 
kauakeaAuthor Commented:
how would i get the  new primary field value  that i need to create the new records in the other 2 tables if not via a custom dialog?
0
 
billmercerCommented:
>how would i get the  new primary field value  that i need to create the new records in the other 2 tables if not via a custom dialog?
Really you should use a serial number or an auto-enter field for the primary key. The database key shouldn't be something that users can create or modify, and it shouldn't depend on information in the database itself, such as names, phone numbers, etc.
0
 
lesouefCommented:
define a variable with the new primary field value once the 1st record is created, then use it to define new records IDs in other tables.
need an example?
0
 
kauakeaAuthor Commented:
an example would be excellent... thanks
0
 
lesouefCommented:
http://www.lesouef.net/files/new_rec.fp7
rough example, see the unique script to create records in 3 unlinked tables with the same ID
0
 
kauakeaAuthor Commented:
thanks lesouef, that works for me
0
 
lesouefCommented:
ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now