Filter Related Contacts List in Popover

Notes on our latest calendar for FileMaker 13,: DayBack
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Aug 02, 2016 2:52 am
Is it possible to filter the related contacts list used to search and select in the event popover? My contacts table has about 15,000 records but only 500 or so are active at a time and a lot the names are fairly common so it will hard to sift through them all.
Attachments
2016-08-02_06-46-23.png
2016-08-02_06-46-23.png (83.65 KiB) Viewed 16916 times
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Aug 02, 2016 6:40 am
And while this topic is open, is there any way to set a Sort order on the resulting list from the search?
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Aug 02, 2016 8:22 am
Good questions.

There is a way to filter the list, though we don't yet have a way for you to control the sort order.

To show just the 500 active contacts, create a new calculated field in your contact's table that only returns the contact's full name if the contact is active (be sure the result is Text and that the field is indexable). Then use that field on the Related Source No 1 layout where you see "name". (Just swap out the field, don't change the field's object name, which should remain "SourceName".)

Pretty cool hack: thanks for suggesting it, Jason!

- John
John Sindelar
SeedCode
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Aug 02, 2016 9:05 am
Thanks for the reply, John. Not completely understanding how those fields get referenced and displayed, I have this question about the solution. Would there be an issue if a contact were to become Inactive but still have an appointment on the calendar. If the name field I'm referencing becomes blank, I'm assuming that the name would no longer be displayed on the event. Is that correct?
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Aug 02, 2016 9:14 am
In your example the contact would still be displayed =) The Related Source No 1 layout is just used for selecting the contact (so restricting when a name shows there only changes the selection list). Once a contact ID is linked to an event, the display of the contact's name is governed by the DBk_WebViewerSource calc field in your events table... which will continue to use the contact's unfiltered name.

Play with this in a fresh download of DayBack if you don't want to mess with your deployment and I think you'll like it.
John Sindelar
SeedCode
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Tue Aug 02, 2016 11:42 am
Perfect. That's what I was hoping you'd say :D

I'm still in development so I can try it out. Thanks!
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Wed Aug 24, 2016 6:42 am
I found a couple things that are inconsistent with this thread. First, I implemented the indexed calc field that returns a value ONLY when the contact is active. I also appended another value in this calc to make it easier to differentiate between people when searching. I pointed this new field to the name on the Related Source No 1 layout. After doing that, the search box on the Event popover was *searching* on the new field but *displaying* a different field in the results. I know this because I could search on the appended value and expected results were returned.

I then went into DBk_WebViewerSource calc and set my *new* field as the name field in that calc as well which fixed what was being displayed in the search results in an event popover. So, my conclusion was that the name field in Related Source No 1 is for searching and the name field in the DBk_WebViewerSource calc is for displaying.

BUT, after selecting a contact through the search, a *different* name field is being displayed on the Event popover. Where does that one come from? I set my new field in the only two places I'm aware of (Related Source No 1 and the DBk_WebViewerSource calc).
SeedCode Staff
SeedCode Staff
Posts: 190
Joined: Tue Sep 22, 2015 2:27 pm
PostPosted: Wed Aug 24, 2016 9:26 am
Thanks for the follow up here. Nice work making that calculated field even more useful for searching.

The two places you've changed -- the Related Source No 1 layout, and the DBk_WebViewerSource field in your *Contacts* table -- define the values that are seen when searching for a Contact. However, the value of the contact name on an event is determined in the DBk_WebViewerSource field in your *Events* table.

If you'd like to change the Contact field that displays on the events after a contact is assigned, change the field that is mapped to sc_contactName within DBk_WebViewerSource in your Events table. If you want to use that new calculated value that you defined for your filtered search field, you'll need to create another new field that is *not* empty when the contact is inactive. Otherwise, if you mapped to your filtered field to sc_contactName, you'd see a blank value on the Event.

Let me know if this helps!
Posts: 41
Joined: Mon Nov 11, 2013 11:12 am
PostPosted: Thu Aug 25, 2016 6:53 am
Thanks, Dan. I misunderstood John's original response and got the two DBK calc fields mixed up. All good now.
SeedCode Staff
SeedCode Staff
Posts: 190
Joined: Tue Sep 22, 2015 2:27 pm
PostPosted: Thu Aug 25, 2016 8:26 am
Glad to hear you're all set! We'll be here if you have any other questions.

Return to DayBack Calendar for FileMaker

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: