3 Replies Latest reply on Jul 27, 2014 3:58 PM by nihmbrisby

    Recent Records Navigation

    nihmbrisby

      Title

      Recent Records Navigation

      Post

           I'm using Phil's method for populating a global field with recent primary keys.  I use this to display a portal which enables users to navigate to their most recently viewed records.  

           For reference here is the calculation that powers the script:

           Let ( 
           theList =RightValues ( TableA::GLOBAL_recent ; 19 ) ; 
           List ( Left ( theList ; Length (TheList ) - 1 ) ; TableA::ID ) 
           )
            
           In a layout based on TableA, I simply create relationship (tableA::global ------tableA::ID) which is sorted by a timestamp field which updates when a record is visted (let's call it tableA::Last_Visited).
            
           This works great.  However if I am on tableB, and wish to see this same list of recent contacts, there's a difference.  I don't have tableA::GLOBAL to use as a match field.  I can think of several brute force solutions like
            
           1. have a calculation in table b that equals TableA::Global
           2. have an intermediary relationship TableB::ID ------X------ TableA::ID / TableA::Global_recent ------- = --------TableA::ID.  this works, but it doesn't seem to sort and I've read that sorting at the portal level performs less well than at the relationship level
           3.  Modify the initial layout trigger that populates TableA::GLobal to also populates an equivalent TableB::tablea_Global_recent- then simply have TableB::tablea_Global_recent ------=------TableA::ID
            
           Is there a better performing, more standard way of doing such a thing?
            
           Thanks.