Find using global variable

I am fairly new to FileMaker Pro and I am using 8.5. I must
preference this with telling you that my background is in VB and
Access and I am having a heck of a time coming around to the FM way of
doing things. I want to to have a dialog box ask the user for the
keyword they are looking for and then I want to perform a find,
searching several fields for this key word. I thought I could use the
Show Custom Dialog box and somehow set what they enter to a global
variable. Then enter find mode and use the global variable to search
the appropriate fields, but it is just not working. I have went
through many books and forums and just can't get it right. This
should be simple and if I was using Access it would be a breeze. Can
anyone point me in the right direction?
ToppThat [ Do, 12 Juli 2007 21:09 ] [ ID #1766604 ]

Re: Find using global variable

On Jul 12, 1:09 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
> I am fairly new to FileMaker Pro and I am using 8.5. I must
> preference this with telling you that my background is in VB and
> Access and I am having a heck of a time coming around to the FM way of
> doing things. I want to to have a dialog box ask the user for the
> keyword they are looking for and then I want to perform a find,
> searching several fields for this key word. I thought I could use the
> Show Custom Dialog box and somehow set what they enter to a global
> variable. Then enter find mode and use the global variable to search
> the appropriate fields, but it is just not working. I have went
> through many books and forums and just can't get it right. This
> should be simple and if I was using Access it would be a breeze. Can
> anyone point me in the right direction?

There's global variables and global fields. The Custom Dialog script
step can only allow input into fields, not variables. You can use a
global field for the entry, then set a variable (can be a local $) to
that field and set your find fields off that variable. You could also
just set you find fields off the global field, but depending on the
number of Set Fields you have the former might be faster, it's also
easier to change if the script changes.

G
Grip [ Do, 12 Juli 2007 21:18 ] [ ID #1766605 ]

Re: Find using global variable

On Jul 12, 2:18 pm, Grip <g... [at] cybermesa.com> wrote:
> On Jul 12, 1:09 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
>
> > I am fairly new to FileMaker Pro and I am using 8.5. I must
> > preference this with telling you that my background is in VB and
> > Access and I am having a heck of a time coming around to the FM way of
> > doing things. I want to to have a dialog box ask the user for the
> > keyword they are looking for and then I want to perform a find,
> > searching several fields for this key word. I thought I could use the
> > Show Custom Dialog box and somehow set what they enter to a global
> > variable. Then enter find mode and use the global variable to search
> > the appropriate fields, but it is just not working. I have went
> > through many books and forums and just can't get it right. This
> > should be simple and if I was using Access it would be a breeze. Can
> > anyone point me in the right direction?
>
> There's global variables and global fields. The Custom Dialog script
> step can only allow input into fields, not variables. You can use a
> global field for the entry, then set a variable (can be a local $) to
> that field and set your find fields off that variable. You could also
> just set you find fields off the global field, but depending on the
> number of Set Fields you have the former might be faster, it's also
> easier to change if the script changes.
>
> G

Thanks for the guidance. Here is what I am doing:

Set Error Capture [On]
Allow User Abort [Off]
Go to Layout ["frm_Competative Shopping Detail" (All Competative
Data)]
Show All Records (I don't know if this is necessary, but I want to
make sure what I do will be done on all records, not a subset of
records)
Show Custom Dialog [ Title:"Component Search
Criteria";Message:"Please enter a keyword for the component you want
to find";Buttons: "OK","Cancel";Input#1:All Competative
Data::SearchCrit, "Component"]
If [Get (LastMesssageChoice)=1]
Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
End if (I know I still need to add a part to handle when they
select cancel)
Enter Find Mode [ ]
Set Field [All Competitive Data::Reusbl10=$$Component]
Perform Find [ ]
(I still need to add something in case the find does not return
anything)

This code does not find what I am looking for and it should, I am
using a keyword that I know some records contain. Any idea what I am
doing wrong?
Thanks!
ToppThat [ Do, 12 Juli 2007 21:45 ] [ ID #1766607 ]

Re: Find using global variable

On Jul 12, 2:45 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
> On Jul 12, 2:18 pm, Grip <g... [at] cybermesa.com> wrote:
>
>
>
>
>
> > On Jul 12, 1:09 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
>
> > > I am fairly new to FileMaker Pro and I am using 8.5. I must
> > > preference this with telling you that my background is in VB and
> > > Access and I am having a heck of a time coming around to the FM way of
> > > doing things. I want to to have a dialog box ask the user for the
> > > keyword they are looking for and then I want to perform a find,
> > > searching several fields for this key word. I thought I could use the
> > > Show Custom Dialog box and somehow set what they enter to a global
> > > variable. Then enter find mode and use the global variable to search
> > > the appropriate fields, but it is just not working. I have went
> > > through many books and forums and just can't get it right. This
> > > should be simple and if I was using Access it would be a breeze. Can
> > > anyone point me in the right direction?
>
> > There's global variables and global fields. The Custom Dialog script
> > step can only allow input into fields, not variables. You can use a
> > global field for the entry, then set a variable (can be a local $) to
> > that field and set your find fields off that variable. You could also
> > just set you find fields off the global field, but depending on the
> > number of Set Fields you have the former might be faster, it's also
> > easier to change if the script changes.
>
> > G
>
> Thanks for the guidance. Here is what I am doing:
>
> Set Error Capture [On]
> Allow User Abort [Off]
> Go to Layout ["frm_Competative Shopping Detail" (All Competative
> Data)]
> Show All Records (I don't know if this is necessary, but I want to
> make sure what I do will be done on all records, not a subset of
> records)
> Show Custom Dialog [ Title:"Component Search
> Criteria";Message:"Please enter a keyword for the component you want
> to find";Buttons: "OK","Cancel";Input#1:All Competative
> Data::SearchCrit, "Component"]
> If [Get (LastMesssageChoice)=1]
> Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
> End if (I know I still need to add a part to handle when they
> select cancel)
> Enter Find Mode [ ]
> Set Field [All Competitive Data::Reusbl10=$$Component]
> Perform Find [ ]
> (I still need to add something in case the find does not return
> anything)
>
> This code does not find what I am looking for and it should, I am
> using a keyword that I know some records contain. Any idea what I am
> doing wrong?
> Thanks!- Hide quoted text -
>
> - Show quoted text -

I think I figure it out. I am now using the global field instead of
the global variable in the Set Field and it works. However, I need to
do multiple set fields. In other words I need to search about 30
fields for this keyword. Not sure how to do this. Do I do a search
and then do an extended search 29 times?

Thanks
ToppThat [ Do, 12 Juli 2007 22:16 ] [ ID #1766609 ]

Re: Find using global variable

In article <1184271394.329025.9850 [at] r34g2000hsd.googlegroups.com>,
ToppThat <topp_that [at] yahoo.com> wrote:

> On Jul 12, 2:45 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
> > On Jul 12, 2:18 pm, Grip <g... [at] cybermesa.com> wrote:
> >
> >
> >
> >
> >
> > > On Jul 12, 1:09 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
> >
> > > > I am fairly new to FileMaker Pro and I am using 8.5. I must
> > > > preference this with telling you that my background is in VB and
> > > > Access and I am having a heck of a time coming around to the FM way of
> > > > doing things. I want to to have a dialog box ask the user for the
> > > > keyword they are looking for and then I want to perform a find,
> > > > searching several fields for this key word. I thought I could use the
> > > > Show Custom Dialog box and somehow set what they enter to a global
> > > > variable. Then enter find mode and use the global variable to search
> > > > the appropriate fields, but it is just not working. I have went
> > > > through many books and forums and just can't get it right. This
> > > > should be simple and if I was using Access it would be a breeze. Can
> > > > anyone point me in the right direction?
> >
> > > There's global variables and global fields. The Custom Dialog script
> > > step can only allow input into fields, not variables. You can use a
> > > global field for the entry, then set a variable (can be a local $) to
> > > that field and set your find fields off that variable. You could also
> > > just set you find fields off the global field, but depending on the
> > > number of Set Fields you have the former might be faster, it's also
> > > easier to change if the script changes.
> >
> > > G
> >
> > Thanks for the guidance. Here is what I am doing:
> >
> > Set Error Capture [On]
> > Allow User Abort [Off]
> > Go to Layout ["frm_Competative Shopping Detail" (All Competative
> > Data)]
> > Show All Records (I don't know if this is necessary, but I want to
> > make sure what I do will be done on all records, not a subset of
> > records)
> > Show Custom Dialog [ Title:"Component Search
> > Criteria";Message:"Please enter a keyword for the component you want
> > to find";Buttons: "OK","Cancel";Input#1:All Competative
> > Data::SearchCrit, "Component"]
> > If [Get (LastMesssageChoice)=1]
> > Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
> > End if (I know I still need to add a part to handle when they
> > select cancel)
> > Enter Find Mode [ ]
> > Set Field [All Competitive Data::Reusbl10=$$Component]
> > Perform Find [ ]
> > (I still need to add something in case the find does not return
> > anything)
> >
> > This code does not find what I am looking for and it should, I am
> > using a keyword that I know some records contain. Any idea what I am
> > doing wrong?
> > Thanks!- Hide quoted text -
> >
> > - Show quoted text -
>
> I think I figure it out. I am now using the global field instead of
> the global variable in the Set Field and it works. However, I need to
> do multiple set fields. In other words I need to search about 30
> fields for this keyword. Not sure how to do this. Do I do a search
> and then do an extended search 29 times?
>
> Thanks

Firstly there's a problem in your script above, but It's probably just
a typo in transferring it to the newsgroups.

You've got:
Set Field [All Competitive Data::Reusbl10=$$Component]

which makes no sense (FileMaker should display an error) and should be:

Set Field [All Competitive Data::Reusbl10, $$Component]

The "=" symbol should be a comma.



To find the same keyword in 30 fields you will have to script an
"extended" search, or more precisely an OR search, which is done in the
same way you would perform the search manually - by adding extra Find
requests.
ie.
Enter Find Mode []
Set Field [All Competitive Data::Reusbl10, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl11, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl12, $$Component]
New Record / Request []
Set Field [All Competitive Data::Reusbl13, $$Component]
...
New Record / Request []
Set Field [All Competitive Data::Reusbl40, $$Component]
Perform Find []








Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Helpful Harry [ Do, 12 Juli 2007 22:57 ] [ ID #1766611 ]

Re: Find using global variable

On Jul 12, 3:57 pm, Helpful Harry <helpful_ha... [at] nom.de.plume.com>
wrote:
> In article <1184271394.329025.9... [at] r34g2000hsd.googlegroups.com>,
>
>
>
>
>
> ToppThat <topp_t... [at] yahoo.com> wrote:
> > On Jul 12, 2:45 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
> > > On Jul 12, 2:18 pm, Grip <g... [at] cybermesa.com> wrote:
>
> > > > On Jul 12, 1:09 pm, ToppThat <topp_t... [at] yahoo.com> wrote:
>
> > > > > I am fairly new to FileMaker Pro and I am using 8.5. I must
> > > > > preference this with telling you that my background is in VB and
> > > > > Access and I am having a heck of a time coming around to the FM way of
> > > > > doing things. I want to to have a dialog box ask the user for the
> > > > > keyword they are looking for and then I want to perform a find,
> > > > > searching several fields for this key word. I thought I could use the
> > > > > Show Custom Dialog box and somehow set what they enter to a global
> > > > > variable. Then enter find mode and use the global variable to search
> > > > > the appropriate fields, but it is just not working. I have went
> > > > > through many books and forums and just can't get it right. This
> > > > > should be simple and if I was using Access it would be a breeze. Can
> > > > > anyone point me in the right direction?
>
> > > > There's global variables and global fields. The Custom Dialog script
> > > > step can only allow input into fields, not variables. You can use a
> > > > global field for the entry, then set a variable (can be a local $) to
> > > > that field and set your find fields off that variable. You could also
> > > > just set you find fields off the global field, but depending on the
> > > > number of Set Fields you have the former might be faster, it's also
> > > > easier to change if the script changes.
>
> > > > G
>
> > > Thanks for the guidance. Here is what I am doing:
>
> > > Set Error Capture [On]
> > > Allow User Abort [Off]
> > > Go to Layout ["frm_Competative Shopping Detail" (All Competative
> > > Data)]
> > > Show All Records (I don't know if this is necessary, but I want to
> > > make sure what I do will be done on all records, not a subset of
> > > records)
> > > Show Custom Dialog [ Title:"Component Search
> > > Criteria";Message:"Please enter a keyword for the component you want
> > > to find";Buttons: "OK","Cancel";Input#1:All Competative
> > > Data::SearchCrit, "Component"]
> > > If [Get (LastMesssageChoice)=1]
> > > Set Variable [$$Component; Value:All Competitive Data::SearchCrit]
> > > End if (I know I still need to add a part to handle when they
> > > select cancel)
> > > Enter Find Mode [ ]
> > > Set Field [All Competitive Data::Reusbl10=$$Component]
> > > Perform Find [ ]
> > > (I still need to add something in case the find does not return
> > > anything)
>
> > > This code does not find what I am looking for and it should, I am
> > > using a keyword that I know some records contain. Any idea what I am
> > > doing wrong?
> > > Thanks!- Hide quoted text -
>
> > > - Show quoted text -
>
> > I think I figure it out. I am now using the global field instead of
> > the global variable in the Set Field and it works. However, I need to
> > do multiple set fields. In other words I need to search about 30
> > fields for this keyword. Not sure how to do this. Do I do a search
> > and then do an extended search 29 times?
>
> > Thanks
>
> Firstly there's a problem in your script above, but It's probably just
> a typo in transferring it to the newsgroups.
>
> You've got:
> Set Field [All Competitive Data::Reusbl10=$$Component]
>
> which makes no sense (FileMaker should display an error) and should be:
>
> Set Field [All Competitive Data::Reusbl10, $$Component]
>
> The "=" symbol should be a comma.
>
> To find the same keyword in 30 fields you will have to script an
> "extended" search, or more precisely an OR search, which is done in the
> same way you would perform the search manually - by adding extra Find
> requests.
> ie.
> Enter Find Mode []
> Set Field [All Competitive Data::Reusbl10, $$Component]
> New Record / Request []
> Set Field [All Competitive Data::Reusbl11, $$Component]
> New Record / Request []
> Set Field [All Competitive Data::Reusbl12, $$Component]
> New Record / Request []
> Set Field [All Competitive Data::Reusbl13, $$Component]
> ...
> New Record / Request []
> Set Field [All Competitive Data::Reusbl40, $$Component]
> Perform Find []
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)- Hide quoted text -
>
> - Show quoted text -

Thank You / Thank You / Thank You!!! I have only been working on
this for 2 days! I have it working and now I can go on my vacation
and not keep thinking about this - it was driving me crazy.
ToppThat [ Do, 12 Juli 2007 23:26 ] [ ID #1766613 ]

Re: Find using global variable

Instead of a custom dialog, make a small layout that behaves like a modal
dialog, then you can have several fields, even use pop-up menus, check
boxes, etc.

The pop-up can display only values that have been used (even though there
are many mor ein the pop-up list used by the enter layout).

You can lock a small layout in an new window to not allow the user to close
the box without an explicit cancel or action. The script for that is only 3
steps.

Create new window (name, size)
goto layout (new small layout)
hide and lock status area
allow user abort [off]
loop
pause/resume script [indefinitely]
beep
end loop

then in the find script, besure to add
halt script

Guy









"ToppThat" <topp_that [at] yahoo.com> wrote in message
news:1184267371.527708.142460 [at] 22g2000hsm.googlegroups.com...
>I am fairly new to FileMaker Pro and I am using 8.5. I must
> preference this with telling you that my background is in VB and
> Access and I am having a heck of a time coming around to the FM way of
> doing things. I want to to have a dialog box ask the user for the
> keyword they are looking for and then I want to perform a find,
> searching several fields for this key word. I thought I could use the
> Show Custom Dialog box and somehow set what they enter to a global
> variable. Then enter find mode and use the global variable to search
> the appropriate fields, but it is just not working. I have went
> through many books and forums and just can't get it right. This
> should be simple and if I was using Access it would be a breeze. Can
> anyone point me in the right direction?
>
Guy [ Sa, 14 Juli 2007 19:58 ] [ ID #1768480 ]
Datenbanken » comp.databases.filemaker » Find using global variable

Vorheriges Thema: Simple question: Printing a layout structure with field names?
Nächstes Thema: FM9 & SQL