5 Replies Latest reply on Jan 16, 2009 3:49 AM by LightningAd

    Copying Data from the Previous Record...whats the best method?

    LightningAd

      Title

      Copying Data from the Previous Record...whats the best method?

      Post

      I have seen a really useful function on a database i often have to use, and would like to add the same kind of functionality to the database i am making...

       

      when a new record is created, i'd like to have a "Copy Data from Previous Record" option. I don't want the entire record to be copied, but specific fields (and i don't want to give the option about which fields either). It will just help speed up data entry and also avoid too much repetition.

       

      Problem is i am not sure how to achieve this? 

       

      thanks in advance

      Adam 

        • 1. Re: Copying Data from the Previous Record...whats the best method?
          raybaudi
            

          > i'd like to have a "Copy Data from Previous Record" option

           

          There is such option...

           

          Go to check the options of auto-enter a value for those fields.

          • 2. Re: Copying Data from the Previous Record...whats the best method?
            TomM
              

            I do something similar in my solution, and I use 'Duplicate Record'. That will copy all fields to a new record. If you need more fields copied than not then I would recommend this method, then use a script to clear the fields you dont want copied.

             

            Or, if there are less fields you want copied then use a script to store the contents of the fields you want into variables from the current record, then create a new record, then copy these variables back into the fields on the new record.

             

            Hope that helps.

            Tom. 

            • 3. Re: Copying Data from the Previous Record...whats the best method?
              LightningAd
                

              thanks for the quick responses...

               

               

              Daniele - i had spotted that, but i thought by using the Auto-Enter option every time i created a new record, the data would be copied from the previous record.   I want to offer the feature as an option on a new record, instead of it being the default behaviour. Thats my understanding of the auto enter option...i could be very wrong!

               

               

              Tom - just to help me get my head around things...when you use "duplicate Record" is that whilst you are in the record being duplicated?

               

              Your second suggestion sounds like the most appropriate method for my needs...i just need to figure out how to create a script to do that!

               

              regards

              Adam 

              • 4. Re: Copying Data from the Previous Record...whats the best method?
                TomM
                  

                Hi,

                 

                Yeah, so while viewing the record you want to duplicate, either click the 'Duplicate Record' button on the toolbar, or have a script that will do so.

                 

                For my second suggestion, while in the record you want to copy fields from, assuming you want to copy the contents of the fields called Text1, Text2, and Text3, in a table called myTable, script the following and execute it from a button... 

                 

                Set Variable [$myVar1; myTable::Text1]

                Set Variable [$myVar2; myTable::Text2]

                Set Variable [$myVar3; myTable::Text3] 

                New Record/Request

                Set Field [myTable:Text1; $myVar1] 

                Set Field [myTable:Text2; $myVar2] 

                Set Field [myTable:Text3; $myVar3]

                 

                This will then give you a new record with the 3 fields identical to the record you were on previously.

                 

                Hope that helps,

                Tom. 

                • 5. Re: Copying Data from the Previous Record...whats the best method?
                  LightningAd
                    

                  thats great Tom...many thanks.

                   

                  perfect jumping off point for me to get working on.

                   

                  regards

                  Adam