In article <1124739483.885720.133620 (AT) g14g2000cwa (DOT) googlegroups.com>,
squeed2000 (AT) yahoo (DOT) com wrote:
Quote:
I have a layout that I send a user to from 2 other layouts. I want the
user to be unable to use a button on the destination layout if they are
sent there from layout 1 but be able to use it if they are sent from
layout 2.
Is this possible ? |
Use a Global field to store the layout the user came from. Then your
button's script can start with an If statment
ie.
If [g_From_Layout = "2"]
{do button function}
End If
This means that your buttons on layout 1 and layout 2 to go to the new
layout will need to run a short script rather than just use the Go To
Layout command in the Define Button window. Their scripts simply need
to set the g_From_Layout field and then Go To Layout.
ie.
Set Field [g_From_Layout, {whichever layout}]
Go To Layout [New_Layout]
In older versiosn of FileMaker you can use either a separate script
(one for each button on the two layouts) or one script that uses the
Status(CurrentLayoutName) to work out which one to set g_From_Layout
to. In FileMaker 7 you can do either of those or one script and the new
script parameter ability.
That's the simple version, but you can add enhancements you can add to
to that.
You can get fancy and have a Global container field to store the button
image, and change that image to a 'ghosted' version when they come from
layout 1. You'll still need the If statment since the button will still
exist and be clickable.
To get around that and be really fancy you can use a relationship and a
portal to actually hide the button when it can't be used. Using a
static 'ghosted' button image on the layout with the portal and real
button layered on top - that way the 'ghosted' button gets hidden by
the portal version whenever the user arrives from layout 2.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)