AnsweredAssumed Answered

Questions about portal filtering using global variables

Question asked by user17152 on Oct 15, 2016
Latest reply on Oct 17, 2016 by user17152

I’m trying to build a “Favorites” view for my solution and am having issues with a filtered portal.  I’ve given my users the ability to “favorite” pretty much every record type in the database.  Every time a user marks a record as favorite, a record is created in the Favorites table with the username, record type (ie: contact, project, etc), and the record id.  The user can view a list of favorites and jump to the appropriate record.  All of this works fine.

 

By default the user’s Favorites list shows all favorites.  There is a global pop-up menu with all record types that triggers a Find if the user wants to focus on a specific type (ie: all favorite contacts only).  No problems here.

 

I then decided to try something different.  Instead of the Favorites list being a list view of the Favorites table, I decided to make it a portal via a relationship from User to Favorite, matching username to username.  I’m trying to create a left-side source panel style interface, so I have a list of all record types on the left and a portal showing all favorites on the right.

 

Since the favorites list could potentially be open in more than one window at a time, I wanted to see if it was possible to filter on a dynamically created variable.  When the user opens the favorites list (changes layout, via a script), a variable is created called $$favorite_WINDOWNAME.  Since the window names in my solution are always unique, I figured I could store my portal filter key here.  And since each window receives its own unique variable, I should be able to have different filters engaged in each window.

 

So everything works, except the portal filter.  The portal is filtered via an Evaluate function:

 

Case (

 

  Evaluate ( "$$favorites_" & Substitute ( Get ( WindowName ); " "; "" ) ) = "showall"; 1;

 

  Evaluate ( "$$favorites_" & Substitute ( Get ( WindowName ); " "; "" ) ) ≠  "showall" and

  Evaluate ( "$$favorites_" & Substitute ( Get ( WindowName ); " "; "" ) ) = user_favorites::favorite_item_record_type; 1;

 

  0

 

)

 

And when I say the portal filter does not work, that’s not entirely true.  It works, but every window’s portal is updated when a selection is made in any window, despite the fact that each window’s portal should be filtered via a different, unique variable.  I wanted to try to make this work using filters and unique variables rather than a global field since I knew that would update every view.  Has anyone tried to do something like this?  I’m assuming it’s not possible?

 

What I find interesting is that the object hiding function works fine using the above Evaluate statement.  I can view the same Favorites layout in multiple windows and have different objects hide in each window based on the value in the unique $$_favorites_WINDOWNAME variable.

 

Any and all thoughts appreciated.  Thanks!

Outcomes