5 Replies Latest reply on Jun 27, 2013 9:23 AM by jormond

    limit field can only be edit at record creation?

    tunghua

      Hi:

       

      I am developing a database that manage inventory in my warehouse, there are some fields that I wish to let user fill only once, once a record is created I am not allwoing anyone to edit those fields anymore, I have been searching and searching for this function but can not find it, can anyone guild me a way?

       

       

      Tunghua

        • 1. Re: limit field can only be edit at record creation?
          LyndsayHowarth

          You could do this with a script trigger and a script:

           

          Firstly the script has to check if the field is in the 'list'. I suggest you create a valuelist for this.

          Then the script has to check if the field already has a value.

          Then it needs to go to the field and select if empty or if it has a value, commit records.

           

          Attach the script trigger to all of the fields concerned nominating the script you have created on field entry.

           

          HTH (but don't want to make it too easy :-)

           

          - Lyndsay

          • 2. Re: limit field can only be edit at record creation?
            Mike_Mitchell

            Lyndsay is correct as far as method. May I suggest, however, that you consider putting a time limit or a deliberate save on your restriction. It's very easy to make a mistake on initial data entry. If you lock it down so nobody can edit a field after the first commit, your users may accidentally commit data they didn't mean to and be stuck with an error in the field.

             

            You can put a time limit on the field by entering a timestamp calculation in another field and comparing it to the current timestamp. You can force a deliberate record commit by turning off the "Save record changes automatically" setting in the Layout Setup dialog.

             

            HTH

             

            Mike

            • 3. Re: limit field can only be edit at record creation?
              Stephen Huston

              You could also do this by using custom permissions in the Manage Security settings for the permission group of people allowed to create/edit this table. You would need a modification timestamp field which auto-entered the ModTS, and set the permissions to allow creation. Then set the Editing permission to limited by calculation:

               

              Get (CurrentHostTS) - ModTSfield ≤ 60

               

              This would give them one minute after any allowed commit to edit what they entered. As soon as they go beyond 60 seconds (or whatever interval you want to allow) since their last allowed edit, they lose all editing privs on the record.

               

              You might want to allow an even longer Delete priv setting similarly (maybe 300 seconds) so they can delete something if they realize they missed the correction time period, just to reduce the risk of garbage.

              • 4. Re: limit field can only be edit at record creation?
                tunghua

                Thanks everyone's answer and help, I really learned a lot from this develop community,

                • 5. Re: limit field can only be edit at record creation?
                  jormond

                  If you can use the built in permissions, that is always a good thing.  One thing you will want to test if you go that route, is the performance impact.

                   

                  Having a custom calc decide whether to allow editing or not can, in some situations, cause a performance slowdown.  Much depends on the record set, and the current action, network, etc.

                   

                  There are times where you may see a drastic performance hit, usually because of the complexity of the calc, and it may or may not be worth the security. Consider it carefully.