4 Replies Latest reply on Jun 27, 2010 3:40 AM by daveealex

    Lock record after 24 hours

    daveealex

      Title

      Lock record after 24 hours

      Post

      I have a small order form that I would like to lock after 24 hours.  I don't want them to change the orders on the order form after the order has been processed, but they can see the order. If possible I would like them to see a message something like " If you would like to change your order please contact us by telephone or email".  I hope this is clear. Thank you

        • 1. Re: Lock record after 24 hours
          sulu762

          Daveealex,

           

          I was able to achieve something similar, except mine locked after 10 minutes.  I entered the

          the File>Manage>Accounts & Privileges window. 

           

          Created a privilege set

           

          Edited the privilege set so that under the “records” drop down menu it reads “custom privileges”.

           

          By selecting that option, another widow pops up where I authorized:

                      View: “Yes”

                      Edit: “Limited”

           

          When I selected “Limited” under the Edit field, it opened the calculation window where I created a calculation based on the Account Name and Time Stamp.  (I authorized the creator of the record to edit the fields within ten minutes of record creation....or at least that was my intent).

           

          Example:

          z_Created by = Get ( AccountName ) and

          z_Created timestamp ≥ (Get ( CurrentTimeStamp )-10)

           

          This is as far as I can help.  Sorry I can’t explain the Time Stamp calculation as I don’t understand it too in depth and I am a very new to scripts and FMP.

           

          Hope this points you in the right direction.

           

          Just wanted to see if I could help someone else instead of always asking for help.

          • 2. Re: Lock record after 24 hours
            FentonJones

            That's much like I do it.  But since Timestamps are per second, shouldn't that be 10*60 for minutes? For 24 hours it would be 24*60*60 (there are 3600 seconds in an hour), or just use 86,400 (number of seconds in a day). 

             

            It is best to use Get (CurrentHostTimeStamp). Otherwise someone could temporarily change the date/time on their own computer, and get past the test. The above works whether the file is actually "hosted" or not. 

             

            P.S. You need to keep the above in mind, especially when doing Finds, if you're in a different time zone than the physical files, especially if over the date line.

             

            As the developer you would NOT have any such Edit restrictions on your Privilege Set (likely Full Access).

            • 3. Re: Lock record after 24 hours
              daveealex

              Thank you both Sulu and Fenton  for the response, sorry I have not responded sooner. I have been very busy this week. I will let you know how it goes this weekend..

               

              David

              • 4. Re: Lock record after 24 hours
                daveealex

                Sulu and Fenton,

                 

                Worked well for my project. I hade to make a couple minor changes to suit my needs. Thank you for you help!!

                 

                David