Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Multiple Virtual Lists on Same Layout

Featured Replies

I am interested in rendering multiple virtual lists on the same layout at the same time. A couple methods have occurred to me, but the method that seems easiest to implement would be to simply use repeating fields for my Virtual List table, and making sure to reference the correct repetitions in the scripting and on the relevant portals. Seems like that way you could have as many virtual lists on a layout as you have repetitions for your fields.

I have no idea if this is a bad idea or a good idea, if it negatively impacts performance compared to other techniques such as having multiple virtual list tables, etc. Is there a widely accepted technique that is considered the best way to render multiple virtual lists on the same layout? Or is my idea as good as any? Any advice here is appreciated!

Repeating fields sounds like a clunky way to handle it. How many portlals do you need? Without knowing details, I'd probably opt for mutiple VL tables. Tables are cheap.

You could also add a "category" value to the virtual lists. And then only show specific categories of records in each portal. I haven't thought all the way through this, but it seems like it could work.

I've done this before - I use different fields to only insert the IDs.  The portal is then filtered down to only produce the records if it's ID is not empty (please see attached).

This is rough of course - you would want to perform a find for your records in each table first before gathering their values into global variables but it should be enough for you to get the idea of it.  I have only used this on smaller displays and I would not use it to filter really large record-sets.

MultipleVirtualLists.fmp12.zip

I'm sorry - I should have created this in version 11 for those not yet moved up in version.  It works in older versions as well.  Attached is graph and here is simple script for it:

#
# GO TO INVOICES
Go to Layout [ “Invoices” (Invoices) ]
Set Variable [ $$invoiceIDs; Value:Invoices::sListOfIDs ] 

# GO TO ACTIVITIES
Go to Layout [ “Activities” (Activities) ]
Set Variable [ $$activityIDs; Value:Activities::sListOfIDs ] 

# MAKE SURE VIRTUAL HAS ENOUGH RECORDS
Set Variable [ $maxCount; Value:Max ( ValueCount ( $$invoiceIDs ) ; ValueCount ( $$activityIDs )
)]
#
Freeze Window
Go to Layout [ “Virtual” (Virtual) ]

If [ Get ( TotalRecordCount ) < $maxCount ]

Loop
New Record/Request
Exit Loop If [ Get ( TotalRecordCount ) ≥ $maxCount ]
End Loop 
End If
#
Go to Layout [ “Dashboard” (Dashboard) ]
#
Refresh Window [ Flush cached join results ]

# #

 

The virtual table only holds a serial ID and then cInvoiceIDs  which is unstored calculation GetValue ( $$invoiceIDs ; serial ) and cActivityIDs which is GetValue ( $$activityIDs ; serial )

 

Multiple_virtual_graph.png

Edited by LaRetta

  • Author

Thanks all for the input! Sounds like there are indeed a lot of variations on how to approach this scenario. And lots of fancy ideas here to experiment with! Really like the idea of using a category field, I think I could see how I could get that to work. And @LaRetta thanks for the detailed examples! It's quite a bit different setup from how I use my virtual table, but there are some great ideas in here that will undoubtedly be helpful to have in my databanks (for example, I really like that automatically expanding virtual table should it not have enough records, haven't seen that before).

Since there are so many ways to approach it, I will likely approach it either as multiple VL tables or my original idea of converting my VL table to repeating fields. Multiple VL tables is pretty easy, but for some reason feels redundant to me. Maybe it sounds clunky to some but for some reason it makes a lot of sense in my head to just use the one virtual table with repeating fields, assuming the performance wouldn't be dramatically different from other methods.

 

What happens when repetition 1 is empty but rep 2 isn't? Blank rows in portal 1?

Edited by Fitch

  • Author

What happens when repetition 1 is empty but rep 2 isn't? Blank rows in portal 1?

​These are good points, and the kinds of things that I need to be mindful of. I'm not able to devote all my time to development so I appreciate the warnings for potential pitfalls.

I haven't dug into this problem just yet as I'm on a deadline for some other things at the moment, but if I get some time to experiment with this perhaps I'll work on a sample file first. If it works well I'll post it here. Otherwise I'll just use multiple VL tables. Thanks again.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.