HampMac Posted June 17, 2006 Posted June 17, 2006 I'm trying to do a Find script where one of the first steps is to Go to Related Record. If there is a related record, then the script runs fine, but if there is not a related record, then Filemaker seems to ignore the script step entirely and the rest of my script gets hosed. I'm try to get Filemaker to report that there are no related records so that I can take the script down a different path (ie. Show Custom Dialog Box stating "no records found). I've tried using Get ( FoundCount ) and Get ( RequestCount ), but these don't seem to do it. Can anyone suggest a way to have Filemaker report no related records exist? I sure would appreciate any advice anyone might offer. Thanks
IdealData Posted June 17, 2006 Posted June 17, 2006 The Count(field) function will do here. Just use the KEY FIELD from the relationship as your "field" parameter.
HampMac Posted June 17, 2006 Author Posted June 17, 2006 Thank you very much for this information, IdealData! I really appreciate you taking the time to answer my question. Have a great day... :)
Søren Dyhr Posted June 17, 2006 Posted June 17, 2006 It will work "Ideal", but not ideally: http://www.nabble.com/Re%3A-Testing-For-The-Existence-Of-Related-Records-p4654755.html --sd
John Mark Osborne Posted June 17, 2006 Posted June 17, 2006 I second that. Please don't use Count to test for related records. I presented on this at DevCon back in 1999. Use IsEmpty or IsValid.
Genx Posted June 17, 2006 Posted June 17, 2006 Weird... but i was about to overhaul a really long script that relies on this so... rightio.
Oldfogey Posted June 18, 2006 Posted June 18, 2006 You can save typing by using - If(Relation::Link) where "Link" is the relationship key field in the target GTRR table. (I think that came from either Comment or Queue.)
HampMac Posted June 21, 2006 Author Posted June 21, 2006 My deep appreciation to everyone's response to this question. You have all been very helpful.
Recommended Posts
This topic is 6730 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now