dbTalk Databases Forums  

Scripted Find

comp.databases.filemaker comp.databases.filemaker


Discuss Scripted Find in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeff Wright
 
Posts: n/a

Default Scripted Find - 01-20-2007 , 08:50 AM






Hi

Using FM 8.5 Advanced.

I have a layout which among other fields has a field where I enter a number.
This number is a reference number to a record contained within another
table. On the same layout is a button which calls a script. The idea of this
script is to find the record contained in the other table. Some of the data
within this table is recorded within variables, the script then returns to
the original table and places the data collected into some other fields of
the record in my first table. All well and good and it works well.

The only problem I have is if I enter an invalid reference number I get the
standard "No records match this set of find requests", which in turn takes
me to the layout of the table from which I was attempting to find a record.
What I want is to go back to my original layout and be able to re-enter the
reference number to find there. Is there a way to do this?


--
Jeff Wright



Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Scripted Find - 01-20-2007 , 10:19 AM






Before Perform Find step:

Set Error Capture [ On ] (This prevents the "No records" message)

After the Perform Find step:

If Get ( FoundCount ) = 0

Exit Script

End If

Alternate: instead of the whole Find thing, use Go To Related Record based on a relationship to the number entered. If there is no related record, nothing happens.

Matt



On 01/20/2007 09:50:34 "Jeff Wright" <jeff (AT) jeffwright (DOT) demon.co.uk> wrote:

Quote:
Hi

Using FM 8.5 Advanced.

I have a layout which among other fields has a field where I enter a
number. This number is a reference number to a record contained within
another table. On the same layout is a button which calls a script. The
idea of this script is to find the record contained in the other table.
Some of the data within this table is recorded within variables, the
script then returns to the original table and places the data collected
into some other fields of the record in my first table. All well and good
and it works well.

The only problem I have is if I enter an invalid reference number I get
the standard "No records match this set of find requests", which in turn
takes me to the layout of the table from which I was attempting to find a
record. What I want is to go back to my original layout and be able to
re-enter the reference number to find there. Is there a way to do this?

Reply With Quote
  #3  
Old   
Jeff Wright
 
Posts: n/a

Default Re: Scripted Find - 01-21-2007 , 05:25 AM



Hi Matt

Many thanks. Works a treat!!

--
Jeff Wright

"Matt Wills" <Im (AT) witz (DOT) end> wrote

Quote:
Before Perform Find step:

Set Error Capture [ On ] (This prevents the "No records" message)

After the Perform Find step:

If Get ( FoundCount ) = 0

Exit Script

End If

Alternate: instead of the whole Find thing, use Go To Related Record based
on a relationship to the number entered. If there is no related record,
nothing happens.

Matt



On 01/20/2007 09:50:34 "Jeff Wright" <jeff (AT) jeffwright (DOT) demon.co.uk> wrote:

Hi

Using FM 8.5 Advanced.

I have a layout which among other fields has a field where I enter a
number. This number is a reference number to a record contained within
another table. On the same layout is a button which calls a script. The
idea of this script is to find the record contained in the other table.
Some of the data within this table is recorded within variables, the
script then returns to the original table and places the data collected
into some other fields of the record in my first table. All well and
good
and it works well.

The only problem I have is if I enter an invalid reference number I get
the standard "No records match this set of find requests", which in turn
takes me to the layout of the table from which I was attempting to find a
record. What I want is to go back to my original layout and be able to
re-enter the reference number to find there. Is there a way to do this?



Reply With Quote
  #4  
Old   
MaximalVariance
 
Posts: n/a

Default Re: Scripted Find - 01-21-2007 , 02:06 PM




Jeff Wright wrote:
Quote:
Hi Matt

Many thanks. Works a treat!!

--
Jeff Wright

"Matt Wills" <Im (AT) witz (DOT) end> wrote in message
news:1201119.YPNXBUCM (AT) news (DOT) verizon.net...
Before Perform Find step:

Set Error Capture [ On ] (This prevents the "No records" message)

After the Perform Find step:

If Get ( FoundCount ) = 0

Exit Script

End If

Alternate: instead of the whole Find thing, use Go To Related Record based
on a relationship to the number entered. If there is no related record,
nothing happens.

Matt



On 01/20/2007 09:50:34 "Jeff Wright" <jeff (AT) jeffwright (DOT) demon.co.uk> wrote:

Hi

Using FM 8.5 Advanced.

I have a layout which among other fields has a field where I enter a
number. This number is a reference number to a record contained within
another table. On the same layout is a button which calls a script. The
idea of this script is to find the record contained in the other table.
Some of the data within this table is recorded within variables, the
script then returns to the original table and places the data collected
into some other fields of the record in my first table. All well and
good
and it works well.

The only problem I have is if I enter an invalid reference number I get
the standard "No records match this set of find requests", which in turn
takes me to the layout of the table from which I was attempting to find a
record. What I want is to go back to my original layout and be able to
re-enter the reference number to find there. Is there a way to do this?
an generalization of matt's step is to use
Get(LastErrorMessage)
and then you can test for what the error was (i think 401 is no found
records? ) and execute conditional scipts based upon the caputred
error...

best,
sg



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.