MariaAux

Display Find Results in a Portal

12 posts in this topic

Hi There,

I did a google search to learn more about displaying find results in a portal i.e. perform a find and only those resluts should be displayed within a portal and I found a couple of ideas. One was the concept of multi-key fields but I noticed the video was done with an older version of Filemaker. With FM 11, we have the ability to do a filter within a portal based on a calcualtion and I wonder whether there isn't an easier way now with FM11 to use this portal filter functionality to produce a portal with only the find results?

Is Multi-keys still the best way or is there a better way with Portal filters?

Thanks so much for your advice and time.

Maria

Share this post


Link to post
Share on other sites

A portal filter doesn't have any "awareness" of the found set, so it can't really help you there. A multi-key field seems like the way to do it.

Share this post


Link to post
Share on other sites

Why do you want to display find results in a portal? What's wrong with displaying them in list view?

Share this post


Link to post
Share on other sites

Is Multi-keys still the best way or is there a better way with Portal filters?

Hi Maria,

It is usually best to use relational filter instead of portal filter because portal filters have to evaluate all records before constraiining the results. This is great stress on your system when you have a lot of records. And since either way, you would need to collect the IDs of the record-set, it is best to use multi-line (global or calculation) in new relationship to the portal. Check out this thread for gathering IDs from a found set: http://fmforums.com/forum/topic/61394-found-set/page__hl__agn%C3%A8s__fromsearch__1

Hi Dan,

Sometimes it helps (when viewing a form layout of multiple records) to see a portal on the side of those same records. It acts as an visual index and can allow click-jumping to specific records within the found set. :)

Share this post


Link to post
Share on other sites

I would qualify that statement about portal filters; you can do both.

If the potential set of unfiltered records is large, then the relationship should be designed as the first filter. Portal filtering can then be used as a secondary filter.

The portal filter calculation will operate on the entire record set of values presented by the relationship. The portal filter calc operates on these records strictly in creation order, independent of how the relationship definition or portal definition sorts them.

Share this post


Link to post
Share on other sites

Thanks, Bruce. Yes, many times we further portal-filter a relationally filtered relationship. Whew! That was a bite-full!

The portal filter calc operates on these records strictly in creation order, independent of how the relationship definition or portal definition sorts them.

I did not know this! I thought this was interesting but wait ... it would not really matter since all of the related records must be walked through by the filter anyway, would it? Where might knowing that sorts are ignored by portal filters, be important? After all, we are talking about filtering and not calculating, right? Thanks for stepping in.

Share this post


Link to post
Share on other sites

Depends on what you are trying to do with the filter calc.

For instance, assume a sorted relationship to a people table, sorted by last name; where the relation uses a global field to match on City.

Set the filter field to "Seattle". Say there are 2000 Seattle people; 75 whose last names begin with "A".

Have a script that sets variable $$names to empty and then does a refresh.

The portal filter uses this calc:

Let( $$names = List( $$names; People::LastName); Left( People::LastName; 1) = "A")

What will the portal show?

(Only the 75 Seattle people whose last names start with "A"; sorted by last name).

What will $$names contain?

(The list of all 2000 Seattle last names; unsorted.)

Share this post


Link to post
Share on other sites

Or consider this variation for the filter calc:

case( Left( People::LastName; 1) = "A";

Let( $$names = List( $$names; People::LastName); 1)

)

Now $$names contains the list of Seattle last names beginning with "A"; but it is unsorted.

If instead you collected the record ID values into the variable, you might have assumed it represented a sorted list. But it won't.

Share this post


Link to post
Share on other sites

Thank you all so much for your invlauable advice. Got me where I wanted to be! Thanks a million

Share this post


Link to post
Share on other sites

Hi Dan, Sometimes it helps (when viewing a form layout of multiple records) to see a portal on the side of those same records. It acts as an visual index and can allow click-jumping to specific records within the found set. :)

I'd never heard of this interface technique before; sounds interesting. I couldn't see any practial use of displaying find results in a portal, so thanks for pointing this out.

Now you got my gears turning though... This could possibly be an alternative to using a filtered portal. It would take a lot more work on the developers end, but it would allow for greater flexability for the users 'filters'.

The portal filter calculation will operate on the entire record set of values presented by the relationship. The portal filter calc operates on these records strictly in creation order, independent of how the relationship definition or portal definition sorts them.

Interesting detail. like LaRetta, I failed to see the relevance of this at first, but your examples were interesting. I can see how this aspect of the portal filter could possibly be levereged for some cool custom feature.

Share this post


Link to post
Share on other sites

Kinda reviving an old topic but I found this intresting. I have a layout that show work orders on the left, on a portal that filter by the work order status, on the right it shows the whole record that is selected on the left portal. All good.

I also have a list layout simple because the search found most of the time contain many records and my users like to visualize all the records and find the one they need, as they usualy dont have the very exact work order ID when they need to use the search, so, using the same layout design that filters the work orders by status, but filtering to show only the found set records is actualy very usefull.

Many records found showing on a list on the left, and the whole record showing all the fields on the right.

 

Share this post


Link to post
Share on other sites

Hey Morenomdz,

Wasn't sure if you had a question there (seemingly not), but your revival of the thread provides a great opportunity to point out that, since the time of the original thread, there have been some significant advances in the area of "Master-Detail" (portal-plus-detail) layouts. See, for example, Todd Geist's Master-Detail and Master-Detail 2.0 techniques at Modular FileMaker, which build upon Bruce's Virtual List technique.

(Also reminds me that it's been a while since I last checked to see what's new at Modular FileMaker—I notice that Dan Smith's got a recent entry—so I guess I know what I'm going to be doing this morning.)

hth,

Mark

1 person likes this

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • Filtering a portal with case shows too many results
      By justakid
      Hi All,
      I am trying to filter a portal using case to display records matching only one condition (the first it match going down), but it looks like the filter is taking into consideration all the options and displaying related records that match any of the conditions.
      EG:
      Case (
      newA = oldA ; 1 ;
      newB = oldB ; 1 ;
      newC = oldC ; 1 ;
      newD = oldD ; 1 ;
      0)
      I thought the filter would work by only showing me the records that matched the first matched condition, but instead it's showing records that match any of the conditions.
      EG: if I had a record that had 5 related records, 1 where newA = oldA and 2 where newC=oldC, the portal would show me those 3 records instead a of just the first one which matched the first condition newA = oldA.
      Can anyone give me any suggestions as to how I can get it so that the portal only filter 'stops' checking the case condition once it's found a matched one?
    • Hide calculation on portal field help
      By Grouchy
      Hi, I am trying to hide a field in a portal using a calculation on the "hide" behaviour.
      Based on this article from some versions back - https://www.teamdf.com/blogs/a-very-nice-way-to-format-a-sorted-portal-using-conditional-formatting/. However, I am trying to use Global Variables to achieve this.
      In short, my portal has a "category" field whose value is repeated. And I want to "GroupBy" it, and only show the first occurrence of the category and hide the subsequent ones.
      <category> <name> <description>
      Cat1 ... ...
      Cat1 ... ... << Hide Cat1
      Cat2 ... ...
      Cat2 ... ... << Hide Cat 2
       
      I tried to hide the <category> field using the behaviour with the following calculation:
      Let([ 
      This = Category::Name ; 
      $$Prev = $$NextPrev ;
      $$NextPrev = This
      ] ;
      $$Prev = This
      )
      I keep $$Prev as the previous category value, so that if the current "This" field is the same, I attempt to hide it.
      This will hide all the <category> because presumably $$Prev = This.
       
      However, If I test
      a. $$Prev = "Cat1"
      b. This = "Cat1" 
      "Cat1" gets hidden.
      I am just wondering if there's something wrong with my calculation?
      Thanks in advance!
       
       
       
       
       
    • Find in Portal- Problem
      By dav1089
      Hi,
      I have Contacts portal on Company layout. Now, I can do FIND in other fields of the portal but email field., I already checked inspector > Field Entry in find mode is cheked..
      I have attached screenshots 
       


    • Finding highest value Date field record from Portal
      By dav1089
      Hello,
      Issue:
      I have Sales Activities Portal on each company's record, now I want to list all first rows of portals from each company record on another layout. Now, I also want only those rows with non-empty follow-up date fields too. My Portal is sorted by Activity Date in descending order. 
      What I have done:
      I have onlayoutenter script as below:
      Enter Find Mode Set Field[Daily Log::date_followup; "*"] Set Field[Daily Log::date_activity; Max(Daily Log::date_activity)] Perform Find[] It is fetching all records from each Portal which has non-empty follow-up date value
       
      I want only highest activity date value row from each portal 
    • Empty Portal Row
      By samarthmkt
      Hello friend,
      How we can Restrict for not showing last empty portal row in portal table.