2 Replies Latest reply on Feb 10, 2012 10:31 AM by mdumas

    Update Field on Record Exit

    mdumas

      Hi,

       

      I am using the OnRecordLoad trigger to run a script that run a custom dictionary to highlight certain words in a text field. I need the script to not run if someone else is in the record currently, so I created a field InUse to mark as True when it is in use.

       

      The problem I have is I cannot figure out how to set the field to False on exiting the record. I believe there is no trigger for this. I thought about using a global variable to keep track and update on the next load, but that will not work because of multiple users and these users remaining in the record for an extended time.

       

      Does anyone know of a technique to update a field in a previously viewed record?

       

      Thank you.

        • 1. Re: Update Field on Record Exit
          RayCologon

          Hi mdumas,

           

          For a variety of reasons, I'd say it's not ideal (and probably not necessary) to modify a field every time someone enters or exits a record.

           

          Instead, I'd suggest you have your script that runs OnRercordLoad check whether the record is being edited by another user by first calling the Open Record/Request command and testing for an error. If the result is a zero (no error) then the record is not locked, in which case your script can proceed, otherwise it can exit.

           

          Does that solve your problem?

           

          Regards,

          Ray

          ------------------------------------------------

          R J Cologon, Ph.D.

          FileMaker Certified Developer

          Author, FileMaker Pro 10 Bible

          NightWing Enterprises, Melbourne, Australia

          http://www.nightwingenterprises.com

          ------------------------------------------------

          • 2. Re: Update Field on Record Exit
            mdumas

            Thanks for the quick response. That was perfect and simple!