Script question

Hi,

I want a script, which is activated by a button, and changes to another
layout. There it shall search in a certain field for a value of the
other table.

How does the search instruction has to look like? Is it possible to use
variables?

cd
Christian Dressler [ Do, 06 September 2007 18:19 ] [ ID #1813816 ]

Re: Script question

Christian Dressler wrote:
> Hi,
>
> I want a script, which is activated by a button, and changes to another
> layout. There it shall search in a certain field for a value of the
> other table.

The basic thing about a lot of scripts is that they simply mirror what
you would do if you were doing it manually:

Switch to the desired layout
Enter Find Mode
Enter the search value in the field to be searched
Perform Find

Scripted, not much difference:

Go To Layout [ YourLayout ]
Enter Find Mode
Set Field [ theSearchField ; theSearchValue ]
Perform Find

>
> How does the search instruction has to look like? Is it possible to use
> variables?

Are you using a version of FileMaker capable of script variables?

Assuming you are, use the script variable as theSearchValue in the third
step of the script.

Matt
--
Free FileMaker Technique Demos: http://www.VirtualVermont.com/FMP

My Custom Functions:
http://www.briandunning.com/filemaker-custom-functions/resul ts.php?keyword=wills
Matt Wills [ Fr, 07 September 2007 00:51 ] [ ID #1814695 ]

Re: Script question

>> Hi,
>>
>> I want a script, which is activated by a button, and changes to
>> another layout. There it shall search in a certain field for a value
>> of the other table.
>
> The basic thing about a lot of scripts is that they simply mirror what
> you would do if you were doing it manually:
>
> Switch to the desired layout
> Enter Find Mode
> Enter the search value in the field to be searched
> Perform Find
>
> Scripted, not much difference:
>
> Go To Layout [ YourLayout ]
> Enter Find Mode
> Set Field [ theSearchField ; theSearchValue ]
> Perform Find
>
>>
>> How does the search instruction has to look like? Is it possible to
>> use variables?
>
> Are you using a version of FileMaker capable of script variables?
>
> Assuming you are, use the script variable as theSearchValue in the third
> step of the script.
>
> Matt

Thanks four answer. But my problem is: how can I specify the content of
another table's field in "theSearchValue" ?

cd
Christian Dressler [ Fr, 07 September 2007 09:40 ] [ ID #1814704 ]

Re: Script question

In article <fbqvjr$f23$1 [at] online.de>, Christian Dressler <deoc [at] gmx.de>
wrote:

> >> Hi,
> >>
> >> I want a script, which is activated by a button, and changes to
> >> another layout. There it shall search in a certain field for a value
> >> of the other table.
> >
> > The basic thing about a lot of scripts is that they simply mirror what
> > you would do if you were doing it manually:
> >
> > Switch to the desired layout
> > Enter Find Mode
> > Enter the search value in the field to be searched
> > Perform Find
> >
> > Scripted, not much difference:
> >
> > Go To Layout [ YourLayout ]
> > Enter Find Mode
> > Set Field [ theSearchField ; theSearchValue ]
> > Perform Find
> >
> >>
> >> How does the search instruction has to look like? Is it possible to
> >> use variables?
> >
> > Are you using a version of FileMaker capable of script variables?
> >
> > Assuming you are, use the script variable as theSearchValue in the third
> > step of the script.
> >
> > Matt
>
> Thanks four answer. But my problem is: how can I specify the content of
> another table's field in "theSearchValue" ?
>
> cd

Either as a script variable in a fairly recent version of Filemaker, or
as a global field in earlier versions.

An early script step, while still in the layout of the first table, is
to set either the script variable or the global field to the value in
the field that you want to use as the basis for the search in the second
layout.

Then when you get to the second layout and the find mode, specify the
value in the search field to be previously set script variable or global
field.

--
For email, change <fake> to <earthlink>
Bill Collins
bill [ Fr, 07 September 2007 13:57 ] [ ID #1814706 ]

Re: Script question

> Either as a script variable in a fairly recent version of Filemaker, or
> as a global field in earlier versions.
>
> An early script step, while still in the layout of the first table, is
> to set either the script variable or the global field to the value in
> the field that you want to use as the basis for the search in the second
> layout.
>
> Then when you get to the second layout and the find mode, specify the
> value in the search field to be previously set script variable or global
> field.
>
And this is my problem: When try to enter search criteria from static
=2 to
=table1::field1 or to
=$Variable or
=Variable

When I show a message windows with the text table::field, it works! But
not within the search instruction. Please, give me an example, what
exactly has to be written in the field for search criteria.

cd
Christian Dressler [ Fr, 07 September 2007 18:41 ] [ ID #1814711 ]

Re: Script question

> Either as a script variable in a fairly recent version of Filemaker, or
> as a global field in earlier versions.
>
> An early script step, while still in the layout of the first table, is
> to set either the script variable or the global field to the value in
> the field that you want to use as the basis for the search in the second
> layout.
>
> Then when you get to the second layout and the find mode, specify the
> value in the search field to be previously set script variable or global
> field.
>

Now it is working!
Instead of just one step I split it up into more steps to commands like
these:

setvar $var,field
search-mode
setfield field, $var
search

sorry, I have a german version, so I can't provide the original terms.

cd
Christian Dressler [ Fr, 07 September 2007 19:08 ] [ ID #1814713 ]
Datenbanken » comp.databases.filemaker » Script question

Vorheriges Thema: Text disappearing from text fields...
Nächstes Thema: Validate Length calculation