View Search Results
am 23.11.2007 14:06:15 von martin.a.john
I have created a database where the user can search for an item number
(partial or full). A script is then run to perform the search and show
results in a separate layout. This layout shows a summary of the
search results with matching items (item number, type and an image).
I now need another script where the user can click on the button next
to the search results and show the record. I have created if/else
statements to take the user to the correct layout (as each type has a
different layout and is stored in different tables). However I cannot
link the item number to show the exact record from the search results.
(Where item number is the common unique field linking the tables in
the back end).
Is there a way to copy the item number from the search results screen
and paste it in find mode when the new layout is open via a script? Or
any other alternative ways such as using the item number from the
search results layout and making this the search term for item number
in layout x ?
Re: View Search Results
am 24.11.2007 09:01:09 von clk
martin.a.john@gmail.com wrote:
> I now need another script where the user can click on the button next
> to the search results and show the record. I have created if/else
> statements to take the user to the correct layout (as each type has a
> different layout and is stored in different tables). However I cannot
> link the item number to show the exact record from the search results.
> (Where item number is the common unique field linking the tables in
> the back end).
>
> Is there a way to copy the item number from the search results screen
> and paste it in find mode when the new layout is open via a script? Or
> any other alternative ways such as using the item number from the
> search results layout and making this the search term for item number
> in layout x ?
Try "go to related record(s)". You have to set up the proper relation
for this, though.
--
http://clk.ch
Re: View Search Results
am 25.11.2007 03:57:53 von Helpful Harry
In article
,
"martin.a.john@gmail.com" wrote:
> I have created a database where the user can search for an item number
> (partial or full). A script is then run to perform the search and show
> results in a separate layout. This layout shows a summary of the
> search results with matching items (item number, type and an image).
>
> I now need another script where the user can click on the button next
> to the search results and show the record. I have created if/else
> statements to take the user to the correct layout (as each type has a
> different layout and is stored in different tables). However I cannot
> link the item number to show the exact record from the search results.
> (Where item number is the common unique field linking the tables in
> the back end).
>
> Is there a way to copy the item number from the search results screen
> and paste it in find mode when the new layout is open via a script? Or
> any other alternative ways such as using the item number from the
> search results layout and making this the search term for item number
> in layout x ?
If the "summary" and the main record are in the same Table, then the
button can simply use the "Go To Layout" command and FileMaker will
display the same record.
If the "summary" and main record are in different, but related, Tables,
then the "Go To Related Record" command should work. This of course may
mean more than just the chosen record is displayed, which would allow
the user to move backwards and forwards through the records, and that
may not be desirable.
If neither of these is applicable, then you can copy the Item Number to
a Global field (or possibly script variable in newer versions of
FileMaker) using the "Set Field" command and then access that data to
perform the Find in the other Table.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: View Search Results
am 26.11.2007 12:03:51 von martin.a.john
Harry
you are right, the "Go To Related Record" is not 100% accurate in this
case.
The option to copy the result and use it in find is more desirable.
However, due to my lack of experience of using Filemaker Pro I cannot
figure out how to perform the copy. As the Item Number I want to copy
is a search result in a layout. Is it possible to copy the number from
a layout then store this in a global field? As the only option
available is to copy from a table. If the script variable is an easier
solution (I am using v8.5) then I would also be interested in learning
more about this.
Best Regards,
Martin
Re: View Search Results
am 26.11.2007 12:58:34 von eyebrown
>However, due to my lack of experience of using Filemaker Pro I cannot
>figure out how to perform the copy. As the Item Number I want to copy
>is a search result in a layout. Is it possible to copy the number from
>a layout then store this in a global field? As the only option
>available is to copy from a table. If the script variable is an easier
>solution (I am using v8.5) then I would also be interested in learning
>more about this.
I'm still stuck in the land of FM 6. But how I handle this situation is
to make a simple script, something like:
Set Field (g_ItemNbr, ItemNbr)
Perform Script (FindItemNbr)
Your original script directs the user to a list layout of search results.
Attach the above script to the actual ItemNber field in this list layout.
The user looks over the list of their results, then selects an item to
view by clicking on its ItemNbr. The act of clicking makes this the
active record, so when the script triggers, the correct ItemNbr is
transferred to the global field g_ItemNbr. From there it's easy to make
your FindItemNbr script using this global as the source of your find
criteria.
I use this basic technique quite a bit. I've found that some lazy or
confused users can't be bothered to click on the displayed ItemNbr itself,
so in Layout Mode I select every field on the list layout (product name,
price, etc.), group them, and assign the script to the group. This way,
they can click anywhere in the displayed line and fire the script.
Steve Brown
Re: View Search Results
am 27.11.2007 01:07:29 von Helpful Harry
In article
,
eyebrown@mindspring.com wrote:
> >However, due to my lack of experience of using Filemaker Pro I cannot
> >figure out how to perform the copy. As the Item Number I want to copy
> >is a search result in a layout. Is it possible to copy the number from
> >a layout then store this in a global field? As the only option
> >available is to copy from a table. If the script variable is an easier
> >solution (I am using v8.5) then I would also be interested in learning
> >more about this.
>
> I'm still stuck in the land of FM 6. But how I handle this situation is
> to make a simple script, something like:
>
> Set Field (g_ItemNbr, ItemNbr)
> Perform Script (FindItemNbr)
>
> Your original script directs the user to a list layout of search results.
> Attach the above script to the actual ItemNber field in this list layout.
> The user looks over the list of their results, then selects an item to
> view by clicking on its ItemNbr. The act of clicking makes this the
> active record, so when the script triggers, the correct ItemNbr is
> transferred to the global field g_ItemNbr. From there it's easy to make
> your FindItemNbr script using this global as the source of your find
> criteria.
Yep, correct. :o)
You can simply "copy" the Item Number to a Global field using the Set
Field command (never use the actual Copy command since that can replace
whatever is on the user's clipboard that they may still want) ... BUT,
in this case I would probably use a Global field in the other table to
make things a little easier. You obviously already have a Relationship
link that is letting you gather in the data to display on the "Search
Results" Layout. This means your basic scripts would be something like:
Button Script (for the Search Results table)
Set Field [Relationship::g_FindItemNbr, ItemNbr]
Perform Script [OtherTableFind]
OtherTableFind (for the other Table)
Go To Layout [FullRecordLayout]
Enter Find Mode []
Set Field [ItemNbr, g_FindItemNbr]
Perform Find []
Since the Button is displayed in a Record, there must be a proper
related record to find (unless something is drastically wrong with the
files!), so you don't need to worry about error chcecking to make sure
a record is found in the other Table.
> I use this basic technique quite a bit. I've found that some lazy or
> confused users can't be bothered to click on the displayed ItemNbr itself,
> so in Layout Mode I select every field on the list layout (product name,
> price, etc.), group them, and assign the script to the group. This way,
> they can click anywhere in the displayed line and fire the script.
Instead of grouping all the fields into one button, another technique
is to draw a reectangle that completely covers the entire Body part of
the Layout. Set this rectangle to have a tansparent / empty line and
fill colour, and then define it as the button. Since the rectangle
covers the entire Body part, it literally means that no matter where
they click they activate the script for that record. This makes it
easier to latter change or add fields without having to Ungroup first
and then afterwards re-Group and re-Define the button.
Since it's "invivisible", it can be a little tricky to later select the
rectangle if you need to alter it. You can still select it by clicking
on the "invisible" line around the outside, but sometimes it's easier
to simply make the fill and line colour the same as the background of
the Layout and move the rectangle behind all the other elements. As
long as you set all the fields to not allow user entry on that Layout,
clicking anywhere will still activate the button.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: View Search Results
am 27.11.2007 18:13:30 von martin.a.john
Harry and Steve
Thanks for the help this works like a charm.
I am going to play around now with using the rectangle as the box so
my users can click as sloppily as they like :)