Copy contents of field
am 11.01.2008 16:13:36 von Guy
WinXP 8.5Adv...
I want to make a field a button and when I click on the field(button) it
copies the contents of the field.
I have a floor plan and I want to click on a room label or field to go
directly to that room's inventory.
--
-------------------------------------------------
Captain Guy
s/v Island Time (Beneteau 352#277)
AICW 845.5
386-689-5088
Re: Copy contents of field
am 11.01.2008 20:57:41 von Helpful Harry
In article <13of1supmd25lcd@corp.supernews.com>, "Guy"
wrote:
> WinXP 8.5Adv...
>
> I want to make a field a button and when I click on the field(button) it
> copies the contents of the field.
>
> I have a floor plan and I want to click on a room label or field to go
> directly to that room's inventory.
From the sound of what you trying to do, a better solution would be to
have a Relationship based on the room (probably a RoomID since it has
to be unique) to the Inventory records. The 'button' can then simply
use the Go To Related Records function with the "Show only related
records" option turned on.
Another less elegant method would be to have the 'button' run a script
that uses the Set Field to 'copy' the field's data into a Global field
(or Variable in newer versions of FileMaker). You can then use this
Global field for whatever you were going to do with the copied data -
perhaps performing a Find in the Inventory records.
Don't use the Copy command - it replaces the clipboard contents and the
user may still want what they previously copied.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: Copy contents of field
am 11.01.2008 21:35:59 von Guy
"Helpful Harry" wrote in message
news:120120080857418981%helpful_harry@nom.de.plume.com...
> In article <13of1supmd25lcd@corp.supernews.com>, "Guy"
> wrote:
>
>> WinXP 8.5Adv...
>>
>> I want to make a field a button and when I click on the field(button) it
>> copies the contents of the field.
>>
>> I have a floor plan and I want to click on a room label or field to go
>> directly to that room's inventory.
>
> From the sound of what you trying to do, a better solution would be to
> have a Relationship based on the room (probably a RoomID since it has
> to be unique) to the Inventory records. The 'button' can then simply
> use the Go To Related Records function with the "Show only related
> records" option turned on.
I cannot get the Button-Field to set a variable nor to goto a related
record.
The ROOM Layout has a field for each room (room1, room2 ... roomn).
Therefore, there is no relationship possible.
The task would be to grab the contents of a field as I click on it.
Probably needs an external function or plug-in.
Of course, a pop-up menu with a go button is easy and works fine, I just
didn't want 2 steps.
Guy
>
> Another less elegant method would be to have the 'button' run a script
> that uses the Set Field to 'copy' the field's data into a Global field
> (or Variable in newer versions of FileMaker). You can then use this
> Global field for whatever you were going to do with the copied data -
> perhaps performing a Find in the Inventory records.
>
> Don't use the Copy command - it replaces the clipboard contents and the
> user may still want what they previously copied.
>
>
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: Copy contents of field
am 12.01.2008 00:01:09 von Helpful Harry
In article <13ofkpf8p8n3tad@corp.supernews.com>, "Guy"
wrote:
> I cannot get the Button-Field to set a variable nor to goto a related
> record.
>
> The ROOM Layout has a field for each room (room1, room2 ... roomn).
> Therefore, there is no relationship possible.
>
> The task would be to grab the contents of a field as I click on it.
> Probably needs an external function or plug-in.
>
> Of course, a pop-up menu with a go button is easy and works fine, I just
> didn't want 2 steps.
You don't need a plug-in or any other extra feature, BUT it may be a
fairly lenghty process to set-up your "clickable" fields if there's
lots of them.
It of course depends on how you've set-up the database / table(s) to
store the Room and Inventory records, but for each field you want
"clickable" you should be able to define a Relationship or a script
that grabs the field's content.
I'm not 100% sure how the Variables work, but using a Global field you
can do something like this which will work in any version of FileMaker:
- Create a Script called "Script_FieldA" which is
something like:
Set Field [g_TemporaryFieldData, FieldA]
Perform Script [Go_To_Inventory]
- Go back to Layout mode, click on the FieldA (and the
label if you want) and set it to be a button that
runs the Script_FieldA script.
Do this for each field you want "clickable", with each field having
it's own SEPARATE script to grab the data into the Global
g_TemporaryFieldDate. The "Go_To_Inventory" script would then do
whatever actions you need to display the Inventory using the copy of
the data in this single Global field - using a single sub-script means
less hassle if you later have to make changes to it.
In newer versions of FileMaker I believe you can set a Variable with
each clickable field and then run a single script. I don't know if the
Variable can read the field's data, but it can at least be used to tell
you which field was clicked and then the script can grab the data. In
this case the script could be something like:
If [$Variable = "FieldA"]
Set Field [g_TemporaryFieldData, FieldA]
End If
If [$Variable = "FieldB"]
Set Field [g_TemporaryFieldData, FieldB]
End If
If [$Variable = "FieldC"]
Set Field [g_TemporaryFieldData, FieldC]
End If
etc.
{Add the commands for displaying the Inventory
based on what is in g_TemporaryFieldData}
Then back in Layout mode, you can click on EACH field and separately
define them to run the script setting the appropriate Variable.
ie.
Click on FieldA, define as button to set
$Variable to "FieldA" and run script
Click on FieldB, define as button to set
$Variable to "FieldB" and run script
etc.
You can achieve a similar result using Relationships - a separate one
for each "clickable" field. eg.
rel_FieldA when FieldA matches Inventory::RoomField
rel_FieldB when FieldB matches Inventory::RoomField
rel_FieldC when FieldC matches Inventory::RoomField
etc.
In Layout mode you can then define each field to "Go To Related
Records" using the appropriate Relationship.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)