4 Replies Latest reply on Jun 12, 2012 12:23 AM by crm

    History of visited records



      I would like to create a field which would show me the last visited records.

      I'm new in FM programming and have no idea on how to do that.

      I can imagine it is a script activated each time I gon on a layout that will place in a table the id of the visited record.

      I should work even if I don't edit the record.


      Any help would be really welcome.

      Thanks a lot.

        • 1. Re: History of visited records

          You could setup a script trigger on the layout (OnRecordLoad) that will take information from the record, go to your table that tracks the visited records, create a new record and set the fields based on the information from the record.

          • 2. Re: History of visited records

            If all you need is a simple text list, create a global field like gNavigationHistory, then write a script which populates this field and is triggered by OnRecordLoad (dialogue Layout Setup, tab Script Triggers). It basically consists of one script step (feel free to add/adjust data and formats according to your needs):


            Set Field [ gNavigationHistory ; MyTable::gNavigationHistory & if ( isEmpty ( MyTable::gNavigationHistory ) ; "Last records visited:¶¶" ; ¶ ) & Get ( CurrentTimestamp ) & " - " & myRecordName ]".


            Some notes: a list compiled with this method will simply grow and grow; you should decide if you want to restrain it to the last x records visited and/or reset it when you close your solution. Also think about what should happen when you visit a record that is already in the list.


            The table-based method suggested by MattLeach if of course more robust and can be used as a proper navigation tool (i.e. to “jump there”), but is also more complicated to implement, especially when you want to include the checks and restraints mentioned above.

            • 3. Re: History of visited records

              If yours is a single-user solution, as you proposed, you could add a field to the table that needs to be tracked.  Make it a TimeStamp field, and update it using MattLeach's OnRecordLoad script trigger.  

              • 4. Re: History of visited records

                If You need a professional Navigation in a medium complexity system this might be the one:

                Dynamic Navigation Schemes — Crumb and Carousel