6 Replies Latest reply on Nov 16, 2010 10:17 AM by st3lla

    Record Modified by another user

    st3lla

      Title

      Record Modified by another user

      Post

      Hello Everybody!

      I have a layout which shows fields from related tables. There is a table called "Woman", where one of its fields is called "Username_modified", and another table called "Womans_Summary".

      Each time I change a field of those of table "Woman" in my layout the field "Username_modified" changes, too. But when I change a field from table "Womans_Summary", the "Username_modified" does not change.

      I tried to add one more field to "Womans_Summary" and relate it to "Username_modified" of "Woman" but it did not work.

      Any ideas of how I can make it work?

      Thanks in advance!

        • 1. Re: Record Modified by another user
          philmodjunk

          If you are using FileMaker 10 or later, you can use the OnObjectSave trigger on the Womans_Summary layout or portal to fire a script that updates the Username_modified field.

          • 2. Re: Record Modified by another user
            st3lla

            Thanks for your immediate response!

            How will this script look like?

            Sorry but as I am new, it is the first time that I am making field update..

            • 3. Re: Record Modified by another user
              philmodjunk

              You haven't told me what auto-enter settings you've chosen for Username_modified. Going by the field name, I'm going to assume it enters the current user name every time the Woman record is modified.

              A single line script should be all that you need:

              Set Field [ Woman::Username_modified ; Get ( CurrentUserName ) ]

              • 4. Re: Record Modified by another user
                st3lla

                Sorry for bothering again but I think I am a bit confused.

                Let's say my main layout is called "Main", where I display fields from 2 tables called "Woman" and "Womans_Summary". 

                How can the field "Username_modified" of table "Woman" which is displayed on "Main" layout getting updated when I change fields of "Woman" but also of "Womans_Summary" on Main layout?

                ps. I am using Filemaker Pro 11 and "Username_modified" settings enter the current user name every time the Woman record is modified.

                Thanks again!

                • 5. Re: Record Modified by another user
                  philmodjunk

                  Keep your auto-enter settings as you have them. This way the user name is logged each time a record in Woman is modified. The script will do the same for you when a related record in Womans_Summary is modified.

                  I'm guessing that your "Main" layout refers to "Woman" in "show records from" in Layout Setup... If I'm wrong, then this won't work as written and I'll need to know the relationships between the layout's table occurrence and the two tables you've mentioned here.

                  1. Use Manage | Scripts to create the script I described earlier
                  2. Enter layout mode.
                  3. If the "Womans_Summary" fields are inside a portal, right click the portal.
                  4. If they are not, select each field from Womans_Summary and right click them.
                  5. Choose Script Triggers and select the OnObjectSave trigger to run the script you just created.
                  • 6. Re: Record Modified by another user
                    st3lla

                    Ok now everything is clear and it works as I want it to work!

                    I really thank you for your help!