1 2 Previous Next 15 Replies Latest reply on Nov 2, 2012 5:38 PM by Stephen Huston

    Using a portal or any other means to show modified records

      Hello,

       

      Looking for a way to display all modified records in a particular "session". I'm working on a FileMaker Go application and I want the user to be able to be able to see everything they have modified before syncing it. Would I used a portal? I know you can create a timestamp field and set it to "Modification - On Commit", however I'm not sure how to set up the relationship, if that's right. Thanks for any help.

        • 1. Re: Using a portal or any other means to show modified records
          filemaker_mmfg

          Usually I do that without using portals. Simply I write in a field (in some table) the date and the time of the last sync. Then I have a script that look for every record modified after that date and time.

          • 2. Re: Using a portal or any other means to show modified records

            That sounds along the lines of what I need. But how would I go about displaying these results. I've been working with FileMaker for a little over a week so I'm very novice.

            • 3. Re: Using a portal or any other means to show modified records
              filemaker_mmfg

              If you are able to enter in Find Mode, set fields for searching values you want and Perform Find, you can write a script (searching script) doing the same: entering in Find Mode, setting the fields date and time to the value you have put before in other fields (in other table) and performing the find. The result will be that you will see the found set showing the modified records.

              You have to learn how to search records and how to write a simple script.

              Every time you do a sync, you have to use another script for setting the date and time in the fields that you will use as reference in the searching script.

              • 4. Re: Using a portal or any other means to show modified records

                Ok, I understand the Find and Perform find, I am using that already to find last names and employee ID's, and I also understand basic scripting. I don't understand how I will relate the items in such a way to get them to display. For example, if the user were to modify a record like marking a checkbox, how can I relate that in such a way to make it display. Ideally, I would like to put it in a portal. I'm already using a couple anyway and theyre very nice for being able to see several similar items at once. However, if the way your describing is better I am absolutely not objected to that. I have created a timestamp fieldi n my main table. Does this field need to have a calculation specified?

                • 5. Re: Using a portal or any other means to show modified records
                  filemaker_mmfg

                  Both way are good. My way is to find records, some time in a new window. The other way is to see records in a portal. If you are prefering the portal, you can create a relationship between the main table and the table where you have the timestamp field of the last sync (or a new occurrence of the same table if the sync timestamp is in the same table). The relationship is: record timestamp > timestamp of the last sync. The portal will show records from the second table based on relationship.  If the database is multiuser, the timestamp of the last sync should be a global field, so that every user has its own value.

                  The timestamp field does not need to be calculated, you can write it when performing the sync, by a script, it is better.

                  • 6. Re: Using a portal or any other means to show modified records

                    Ok when I set up my field for auto-enter time stamp is there any other settings I need to ensure - either on the timestamp table or the main table? I guess what I'm asking for is how to set up the fields correctly so the two are related and the timestamp sets itself each time a record is modified.

                    • 7. Re: Using a portal or any other means to show modified records
                      BruceHerbach

                      The field option "Modification" should be all you need to capture the last modication date and time for the record.

                       

                      HTH

                      Bruce

                      • 8. Re: Using a portal or any other means to show modified records
                        Stephen Huston

                        In addition to the Modification Timestamp field per Bruce, you will want to have an opening script run at login to capture the current timestamp into a global variable for the session so you have that initial value to use when you later want to perform a find on records with a later timestamp in the modifiedTS field.

                        • 9. Re: Using a portal or any other means to show modified records
                          Stephen Huston

                          You could also use this same setup to view all modified records via a portal, by using a X operator with a self-join, filtering the portal on ModificationTS field > $$startTS (the global variable timestamp set during login).

                           

                          [ If the idea is to perform some action on the edited records rather than just view a list of them, then the Find will be more useful than a filtered portal. ]

                          • 10. Re: Using a portal or any other means to show modified records

                            Okay, I've used a self join, used a cartesian join operator, created the global variable that sets the time stap for a "session ID" and set the portal filtering to the correct formula. My portal is still populating with records that I modified yesterday though.

                             

                            Edit: I believe I have everything working, thank you all so much for your help. I ended up using Stephen's method, although I'm sure the others suggested were equally as viable.

                            • 11. Re: Using a portal or any other means to show modified records
                              Stephen Huston

                              Just an additional thought on portal filtering:

                               

                              If this is being used in a multi-user environment, you may want to filter the portal for both

                              ModificationTS >= SessionTS  and  Get(CurrentAccountName) = ModifiedBy field

                              (you can set  up a text field to be the  account name of the latest account to modify the record, in the field auto-enter settings.)

                               

                              This combo would then let users see only the records they had themselves edited in the current session.

                              • 12. Re: Using a portal or any other means to show modified records
                                Oliver_Reid

                                You can simply using contional formatting based on "mod timestamp> last sync timetamp" to make modified record show a in diffrent color -- if that would suffice?

                                • 13. Re: Using a portal or any other means to show modified records

                                  To elaborate on all of this. I built a new table and used a cartesian join to join my new table with my main table: TimeStamp field from d_ModLog_CJ is joined (via "X" operator) with main table field TimeStamp. I applied a filter on my portal on my "Review and Finish" layout that is using table d_ModLog_CJ which correctly displays only the modified records. However, I also have a signature container, as this will be the last layout the user will see before they "sync" the records. Whenever they sign and save their signature this is causing the first record to also populate my portal. I think this is because Im incorrectly joining the tables. Does anyone have a suggestion as to how I can configure the table so its not creating a new record when I "sign off" on all the changes Ive made?

                                  • 14. Re: Using a portal or any other means to show modified records
                                    Oliver_Reid

                                    I belive it is not creating a new record, but is modifying the current record: so now it shows in the portal.

                                    I have dealt with similar issues by having two timestamp fields : one which changes for any modification, and one which does so unless a gobal field "no_timestamp" is set to 1.

                                     

                                    If you use a field of the second type to define the portal, use triggers to set the global to 1 before adding the signature, and back to 0 afterwards.

                                     

                                    Alternatively, put the signature field in seperate table with a 1-1 relationship with the base table. Then adding a sigture will not trip the mod timestamp.

                                     

                                    One further idea: set variable to the time mod when the record is loaded and use that variable in the portal filter. Then adding a signature will not chnage the portal.

                                    1 2 Previous Next