Navigation Between Files 
Author Message
 Navigation Between Files
Is there a way to open (or go back to) a particular database from
antoher database.  I was thinking I could use the Open.... command and
retrieve the destination from a global but the Open doesn't seem to
support this.  I would like to include a "back" button to return the
user to where they came from between the different files in the
solution.  Any and all help is greatly (or is that GREATLY) Appreciated.


Mon, 22 Jan 2001 03:00:00 GMT
 Navigation Between Files


Quote:

>>Is there a way to open (or go back to) a particular database from
>>antoher database.  I was thinking I could use the Open.... command and
>>retrieve the destination from a global but the Open doesn't seem to
>>support this.  I would like to include a "back" button to return the
>>user to where they came from between the different files in the
>>solution.  Any and all help is greatly (or is that GREATLY) Appreciated.

There are a couple ways to handle this.  Simplest is to put create a "goto
layout" script in the destination DB (e.g. DB A ), and a button scripted
to run that script externally from your other database(s): i.e., perform
script [external - DB A:"goto layout".

if you need to goto to different layouts in the other database depending
on a condition in the one you are you can add use a global field in the
destination to store a code for layout you want to goto using something
like this:

if(condition="something")
set field (DB A::gLayoutTarget,"1"
else
set field (DB A::gLayoutTarget,"0"
end if
perform script [external - DB A:"goto layout"

Then in DB A the "goto layout: script would be:

if(gLayoutTarget)=1
Goto layout "option one"
end if
if(gLayoutTarget)=0
Goto layout "option two"
end if

In general when scripting buttons on FMP layouts you are better off
linking them you scripts you write rather than the default selections. For
example, a find button should link to script with error recovery if no
records are found, or different layouts (form or list) depending on
whether a single or multiple record has been found.  In like manner a "new
record" button script should first take the user to the proper layout for
new record input.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
cgardner-at-nova.org * http://super.nova.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Fri, 26 Jan 2001 03:00:00 GMT
 Navigation Between Files
hey Robert,

Quote:
}Is there a way to open (or go back to) a particular database from
}antoher database.  I was thinking I could use the Open.... command and
}retrieve the destination from a global but the Open doesn't seem to
}support this.  I would like to include a "back" button to return the
}user to where they came from between the different files in the
}solution.  Any and all help is greatly (or is that GREATLY) Appreciated.

due to filemakers rather limited scripting interface, there is really
no way to implement a "universal" back button, unless you setup {*filter*}to
go back to every possible place you came from.. (real painful). this is
mostly because the open file setup is typical of the filemaker script
interface.. you need to specify a file in this dumb requester for the
script step.. no choices.. = no power..

anyway, applescript (although also real bad) it can use variables.. so
it would be possible to setup a couple applescripts that would let you
"go back" to wherever is was you came from..  IE have a small couple
step script, that sets the current file and layout to a global database
then a second script that would "open" the "camefrom" database, and "go
to" the "camefrom" layout.

if you are on mac and don't want know/want-to-mess-with applescript, i
could probably do it for you.. it would be a nice function to have..

also there is some thing for going back to "original" layout.. i have
not played with it, yet, so i do not know what is meant by "original"
if it is original layout for this database, original to this script,
or original for the first script in a series of scripts that ended up
where you are.. if this is not limited to the current database, then
it may be able to serve your needs..

the example for this "go to original layout" in the filemaker help
shows some stuff, but it looks like it is all within one database..


Sur-Tech / Ami-Tech    (408) 496-6348 Xt 247     Santa Clara CA 95050
                          www.Sur-Tech.com



Mon, 29 Jan 2001 03:00:00 GMT
 Navigation Between Files

Quote:

> hey Robert,

> }Is there a way to open (or go back to) a particular database from
> }antoher database.  I was thinking I could use the Open.... command and
> }retrieve the destination from a global but the Open doesn't seem to
> }support this.  I would like to include a "back" button to return the
> }user to where they came from between the different files in the
> }solution.  Any and all help is greatly (or is that GREATLY) Appreciated.

> due to filemakers rather limited scripting interface, there is really
> no way to implement a "universal" back button,

This is true. But there ARE, as always, workarounds. Insist your users
move through the databases using your navigation buttons..hide status
area, remove menu items using the plugins for that. (this creates real
work though since you then have to create and script EVERYTHING,
including printing, sorting, record creation and deletion.)

Then on each button script, as you leave a layout, set a global "last
layout" locator field with the layout number...and set the "Back" script
to go to a layout based on that field's value.  If you make a separate
database holding only this field, I suppose you can find a way to make
this work through the entire solution...haven't tried it out, but it
might be possible.

Ask yourself...is having that Back function that important? If it is, go
for it!

Lynn Allen
Allen & Allen Semiotics         FSA Member - Filemaker Pro Consulting
http://www.semiotics.com        Web & Graphic Design



Mon, 29 Jan 2001 03:00:00 GMT
 Navigation Between Files
hey Lynn,

Quote:
}This is true. But there ARE, as always, workarounds. Insist your users
}move through the databases using your navigation buttons..hide status
}area, remove menu items using the plugins for that. (this creates real
}work though since you then have to create and script EVERYTHING,
}including printing, sorting, record creation and deletion.)
}
}Then on each button script, as you leave a layout, set a global "last
}layout" locator field with the layout number...and set the "Back" script
}to go to a layout based on that field's value.  If you make a separate
}database holding only this field, I suppose you can find a way to make
}this work through the entire solution...haven't tried it out, but it
}might be possible.
}
}Ask yourself...is having that Back function that important? If it is, go
}for it!
}
}Lynn Allen
}Allen & Allen Semiotics         FSA Member - Filemaker Pro Consulting
}http://www.semiotics.com        Web & Graphic Design

ooch ouch, hurt hurt.. the other question is, "is using filemaker worth
all the headaches?" i kinda enjoy all the silly little puzzles that
are created by filemakers lack of any decent programming interface..
they can really be interesting, and fun to mess about with.. but at
the same time, i've been forced to start learning applescript because
there are some functions that really would be cool, like a universal
"back" button..

here is the applescript solution.. it requires a global database, and
some field to relate to the global database on.. this can be a "fake"
field, or if you actually want the possibility of multiple databases
(say hosting info for 3-4 companies) then you could use a real field
such as ThisCompanyID.. (extra code for this not included here, just
wanted to see if basic function would work, at this point)

so in each database file you include a little script call it say
"GetBack" or "BreadCrumbs" whatever seems fun.. it is 2 lines in
the script editor

Set Field [3Globals::PrevDataBase2, 3Status(CurrentFileName)2]
Set Field [3Globals::PrevLayoutName2, 3Status(CurrentLayoutName)2]

whenever you have a button that "leaves" the database and wonders off
you can have "BreadCrumbs" run as part of the exit process..

on wherever you end up you can have a button that runs the applescript
call it "GoBack", "LostInTheWoods" or whatever.. it will look like so

****
tell application "FileMaker Pro"
   if not (exists database "Globals") then
      open "Globals"
   end if
   copy cell "PrevDataBase" of current record of database "Globals" to PrevBase
   copy cell "PrevLayoutName" of current record of database "Globals" to PrevLayout
   if not (exists database PrevBase) then
      copy cell "Path DataBase Files" of current record of database "Globals" to DataPath
      set DataBaseFile to DataPath & ":" & PrevBase
      open file DataBaseFile
   end if
   go to layout PrevLayout of database PrevBase
end tell
****

couple things you may notice.. applescript is setup to open "Globals"
if not already open.. this is probably not really needed, cause if you
put "Globals"  in the same directory as filemaker, filemaker will open
it automatically when you set the global fields.. also if it is not
in the same directory, you will need to setup the path to it..

i don't keep the database files i'm playing with in the filemaker's
direcetory so (other than "GLobals" so i have a path to the files..
this will also help with the multiple companies/or databases idea..
(you could be working on several client solutions at the same time)
each have its own id and directory.. etc.. hence the path to database
files stuff..

now the part about checking if the previous database is open may seem
a little odd, but there could easily be a circumstance where you would
normaly want to close a file when you exited.. if for some reason you
realized you had made an error in the data entry or something, the file
would then need to be opened again..  

that's about it.. so i guess the mac folks can use this.. and the win
folks are outa luck till these folks at filemaker decide to put some
punch into this stupid interface.. heck all they would really need
to do would be to have most of the selectors also work on a field
value.. it seems that because there are no variables in filemaker the
standard answer is a "global" field.. i'm sure i've noticed some one
of the selectors had a ("field value" or "based on field value")  as
one of the options..

filemaker would be at least twice as easy to deal with if this type
of option was a standard on every selector..


Sur-Tech / Ami-Tech    (408) 496-6348 Xt 247     Santa Clara CA 95050
                          www.Sur-Tech.com



Mon, 29 Jan 2001 03:00:00 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Custom Record Navigation buttons

2. MS A2K with SQL Server navigation delete button

3. EM Navigation - SQL Server 2000

4. IIS, session end and automatic navigation

5. ASP dynamic user changeable Navigation bars

6. Navigation of Registrations in a Stored Procedure

7. Navigation on Two or More Fields!

8. Record-navigation on asp-page through storedprocedure?

9. Navigation Implementation

10. Problem with Record Navigation using ADO, MTS, AS/400

11. db navigation troubles: Data Environment hierarchy

12. MDI, Toolbar and DB navigation


 
Powered by phpBB® Forum Software