5 Replies Latest reply on Jun 1, 2011 7:40 AM by obidon

    Record Browse/View Counter

    obidon

      Title

      Record Browse/View Counter

      Post

      Morning

      I am creating a learning/flashcard system.  I have created a data structure which contains all the data etc to be learned and a seperate structure is currently under construction which will allow users to review the data.

      What I need to achieve is a counter system which will enable the system to identify how many times a user has reviewed a record and when.  Help is greatly appreciated.  I am an intermediate level user

      obidon

        • 1. Re: Record Browse/View Counter
          LaRetta_1

          Hi Donald,

          And when you say 'view' you mean 'view a specific layout' and not modified a record?  If you are using vs. 11 then you run a script which creates a new record and logs the timestamp and User by layout script trigger OnLayoutEnter.  Without vs. 11, you would have to tightly control layout switches to script handling and track it that way.

          Either way, you would have table called (maybe) Viewer.  It would contain fields:

          ViewerID (unique auto-enter FM-generated serial number)
          UserID
          CreateDateTime (auto-enter creation timestamp)
          LayoutName ?

          Then, upon entering a layout, this might be script or script portion:

          Set Variable [ $user ; UserID ]
          Set Variable [ $layout ; Get ( LayoutName ) ]
          Freeze Window
          Go To Layout [ layout based upon Viewer ]
          New Record/Request
          Set Field [ UserID ; $user ]
          Set Field [ LayoutName ; $layout ]
          Go To Layout [ original layout ]

          • 2. Re: Record Browse/View Counter
            obidon

            Thanks, the speed of that response was amazing!

            Think of it like this:

            Database A is a set of flashcards which is viewed by the user from Database B.  

            Database A is structured in a set of tables:

            Stage > flashcards

            Database B is structured in a set of tables:

            User > Progress > flashcards(copy)

            What I would like to achieve is a a record of how many time the user views a static flashcard record.  They won't modify the flashcard record.  The timestamp element would be used to decide how often the record would be offered for review

            • 3. Re: Record Browse/View Counter
              LaRetta_1

              Then I would suggest the same approach only using script trigger OnRecordLoad (assuming the view of the record is on form view) instead of OnLayoutEnter.

              Database A is a set of flashcards which is viewed by the user from Database B. 
              Database A is structured in a set of tables:
              Stage > flashcards
              Database B is structured in a set of tables:
              User > Progress > flashcards(copy)

              But I wonder why you have two different databases with many tables.  I have a feeling that it could be one file and only a few tables.  Was this migrated forward from pre-FM7 version?  Everything can still be handled within one file - no need to go to the other files at all (just create an External Reference to them and place their table within the relational graph of your current file).  Then create the layouts in your current file.  It will be much easier to work in.  Variables are file-specific but you can still transfer the values as script parameters to the next script.

              Regardless, the theory would be the same ... you need to create a new record every time the User views the flashcard record and let the auto-enter creation timestamp happen.  You then can count and track how many times the User has viewed the record and can group how many times ALL users have viewed the record (based upon grouping in report by date).

              • 4. Re: Record Browse/View Counter
                obidon

                Thanks very much for your help!  I am running through this and will let you know how I get on.

                Its a new database in FMPro 10.  All the tables are in one file.  I guess I just lacked the jargon to accurately describe what I am doing and needed.

                Many many thanks

                • 5. Re: Record Browse/View Counter
                  obidon

                  Thanks LaRetta,

                  That works beautifully and opens up new commercial opportunities.