Solved

continue a script if a find is empty

Posted on 2004-08-31
8
311 Views
Last Modified: 2010-04-27
is there a way to force a script to continue running after having an empty find? the scenerio is:

i have 4 databases
i have a layout that includes fields from each database
i have a field named selected record in each of the 4 databases
i do a search on each database and mark the selected record field with a 1
i do a find on each database for records with selected records = 1
the script runs fine and returns my desired results if there is at least one record in each database.
however if the find returns empty i get a "modify find or cancel" box.
when i hit cancel the script stops running.
0
Comment
Question by:kauakea
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:prifre
ID: 11957169
Yes, and it is fairly easy. You set manual error handling=on.
You can do that just before the searching and reset afterwards.

It practically means you dont get the dialogs and have to check for >0 found records yourself.

I dont have an english version, so I am uncertain about how the script in english.

with a smile
/prifre
0
 

Author Comment

by:kauakea
ID: 11957397
the purpose of the script is to find all the records with selected records = 1 in all the databases and include them on a layout that i can run a report on.
what does check for >0 found records mean?
0
 
LVL 9

Assisted Solution

by:prifre
prifre earned 400 total points
ID: 11958105
Hi,

Manual errorhandling->On
#use the below two if you know what to search for (as for example "Selected record" = "1")
Find[]
Set Field ("Selected record","1")

Preform Find[]
If (Get(TotalNumberofRecords)>0)
   #preform whatever is to be handled if you fond the records
   #for example replace all field contents of Selected record with 1...
    Replace (No dialog, Selected record,1)
Else
   #preform whatever to do if you did not find any records
End If
Manual errorhandling->Off

(The above is how I would write the script... but it is what I guess it is, since I run a Swedish FileMaker and I have translated from swedish to English... So I might have misspellt.)

anyhow - hope the above helps!

with a smile
/prifre
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:kauakea
ID: 11958486
the if statement would work for <1 because if it finds a record a have no problem, but what i want it to do if no records are found is continue the script and the find operations.
0
 
LVL 9

Expert Comment

by:prifre
ID: 11958824
the script says:
if we find some records, we do one thing, but if we find no records, we do a second thing.
What you actually do is up to you!

you write: "if no records are found is continue the script and the find operations. " 
Does that mean you want the user to be back into find-mode and change the search criteria?
Then add "Enter Find" and "Exit Script" after "Else" in the script!

The point is with Manual errorhandling and checking Get(TotalNumberOfRecords)=0 you can yourself control what should happen if no records are found or more than 0 records are found etc. Scriptwise.

with a smile
/prifre
0
 

Author Comment

by:kauakea
ID: 11959017
the result i am trying to get is to run the script without any user intervention. i would like the script to continue even if one of the databases returns no finds on the marked selection = 1 from the find request
0
 
LVL 28

Accepted Solution

by:
lesouef earned 100 total points
ID: 11970767
so just remove the else condition....
but I think
if (Get(TotalNumberofRecords)>0) is wrong, he probably meant
if (Get(FoundRecords)>0)
otherwise it does not make sense to do this after a find

0
 
LVL 9

Expert Comment

by:prifre
ID: 11976630
Hi,

lesouef is quite correct. I mixed up Get(TotalNumberRecords) and Get(FoundRecords).
/prifre
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question