ggh Posted August 30, 2008 Posted August 30, 2008 I need to omit records that have no records showing in a portal. So far I've been able to isolate records with specific data in the portal, but can seem to do a find for "=" to isolate empty portals. Is there a way to do this?
ggh Posted August 30, 2008 Author Posted August 30, 2008 Found still another part of the problem. I had "do not evaluate if all referenced fields are empty" checked in the calculation - it didn't not consistently find the empty records. Unchecking this seems to solve it.
Vaughan Posted August 31, 2008 Posted August 31, 2008 Make an unstored calc field in the parent record Count( relationship::primary key ) This will display the number of related records each parent record has. Search for Count = 0 to find those records with no related records. Note that if you only want to find records with no related records you could have used the calc IsEmpty( relationship::primary key ) ... which could even be faster. However I find the Count() field more useful, since it can be used to find records that have, say, only 1 related record.
fabriceN Posted August 31, 2008 Posted August 31, 2008 (edited) I'm afraid this means searching an unstored calculation, which is extremely slow. I would rather exclude records that have related records (type "*" in a related field and check the omit check box in the status area) HTH, Fabrice Edited August 31, 2008 by Guest
Søren Dyhr Posted August 31, 2008 Posted August 31, 2008 What about GTRR(FS) twice ....back and forth over the relation, where the last one is Show Omitted Only'ied? Go to Related Record [ From table: “Portalized”; Using layout: “Child” (Portalized) ] [ Show only related records; Match found set ] Go to Related Record [ From table: “Main”; Using layout: “Parent” (Main) ] [ Show only related records; Match found set ] Show Omitted Only --sd
fabriceN Posted September 1, 2008 Posted September 1, 2008 I think GTRR matching foundset would be really slow. And I don't use it anymore becore error trapping is so buggy.
Søren Dyhr Posted September 1, 2008 Posted September 1, 2008 I have thought about that as well, this is why I think that this must solve the error trapping issue: Go to Layout [ “Portalized” (Portalized) ] Show All Records If [ Get ( FoundCount ) ] Go to Related Record [ From table: “Main”; Using layout: “Main” (Main) ] [ Show only related records; Match found set ] Show Omitted Only End If --sd
fabriceN Posted September 1, 2008 Posted September 1, 2008 Nice, but... why ? ;-) Isn't this much simpler ? You don't even need a script do do that (not to mention a layout, a table occurrence, a relationship) PortalFind.fp7.zip
fabriceN Posted September 1, 2008 Posted September 1, 2008 But as we are talking about portal finds, I have to point out that FileMaker 9 introduced what I think is one of the most important bugs (they say it's a fix! no kidding) This has to do with multi-predicates joints and empty values. This file works perfectly with FileMaker 8, not with FileMaker 9 (remember that finds are performed on the host). By not working, I mean that you are not able to find related records that you can see in browse mode. So be careful with old style booleans (1/0 or empty), they must really be booleans (1/0). PortalFindOn9.fp7.zip
comment Posted September 1, 2008 Posted September 1, 2008 you are not able to find related records that you can see in browse mode. By what criteria?
fabriceN Posted September 3, 2008 Posted September 3, 2008 Sorry, I don't understand. Any criteria would fail (e.g. *). Some records (with an empty key) are just not findable.
comment Posted September 3, 2008 Posted September 3, 2008 I still don't understand what am I supposed to look for, and from which context. So far, everything I have tried returns the same results in all versions. Could you provide specific search criteria, or perhaps attach a script to your file?
fabriceN Posted September 3, 2008 Posted September 3, 2008 (edited) Here you are ... errr.. no, it now fails on 8.5 too... sorry, I'm lost here. I have made consistent tests earlier, and it was working with 8.5 and not with 9. Was there a change in the latest upgrade of 8.5 ? PortalFindOn9.fp7.zip Edited September 3, 2008 by Guest
comment Posted September 3, 2008 Posted September 3, 2008 I get the same results with version 7 as I get with 9.
fabriceN Posted September 3, 2008 Posted September 3, 2008 Sorry then. The test case is not correct. I'll try to find back the sample file I have that really illustrates the change between 8 and 9 (because I'm sure there is one !) Fabrice
Recommended Posts
This topic is 5925 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