1 Reply Latest reply on Apr 24, 2017 6:52 PM by philmodjunk

    Record locking & Scripted replace

    maximums

      Hello all!

      How do other people manage Open records? The specific circumstance that prevent the replace function from replacing where a record doesn't return a true when using Get ( RecordOpenState ) or Get ( RecordOpenCount ) and is of concern to me is when a user has a current field on their screen, but they haven't made any changes so it hasn't yet registered as Open. I have some scripted replace steps that involve potentially thousands of records so looping will just take too long to test because another user may click in an already tested record before the looping is finished. Any ideas anybody?

      Cheers

      Linda

        • 1. Re: Record locking & Scripted replace
          philmodjunk

          You should not do batch updates of that scale when it's possible that other users have locked a record in the batch being updated. This can mean using a schedule to run the script late at night. Sometimes, you don't have that option though.

           

          I don't understand this concern:

           

          and is of concern to me is when a user has a current field on their screen, but they haven't made any changes so it hasn't yet registered as Open.

          If they don't have the record open, it's not locked and won't keep your replace script from updating.

           

          You could use a looping script that tests for a record lock error after attempting to open a record for editing, but just as with replace field contents, you have to decide what you want your script to do with that locked record. Using a Replace Field Contents, you can check for a returned error code to know that any records in the found set were locked and then perform a find to isolate any records that were not modified to get to the records that were not modified due to locks.

           

          Once you have a locked record, you could:

           

          Put it's primary key in a list to try to update later.

          have the script email you with the info on the records to pursue later

          Log the error in a log table along with the record primary keys to deal with later