Solved

continue a script if a find is empty

Posted on 2004-08-31
8
300 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now