?
Solved

continue a script if a find is empty

Posted on 2004-08-31
8
Medium Priority
?
334 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 1600 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 400 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Loops Section Overview
Suggested Courses

864 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