4 Replies Latest reply on Jun 1, 2009 7:30 AM by abitech

    moving field content

    abitech

      Title

      moving field content

      Post

      Hello,

      I would like to create a script that moves the content of 4 fields (i.e.: fields a, b,c,d) of the current record into another field (e), separated by a space or new paragraph. For example:

       

      a = name

      b = surname

      c= age

       

      and after using the script: 

       

      e = name surname age

       

      ...or:

       

      e =

      name

      surname

      age

       

      Does anyone know how to do this?

       

      abitech

        • 1. Re: moving field content
          LaRetta_1
            

          You haven't indicated what you need to do with this new field information but a scrript isn't necessary.  Create a calculation (result is TEXT) with:

           

          NameField & " " & SurNameField & " " & AgeField

           

          ... it is known as concatenation (combining several fields together with a space between.  If you want the calculation to be a multiline, it would be:

           

           

          NameField & ¶ & SurNameField & ¶ & AgeField

           

           

          UPDATE: depending upon why you need this information, you might always want to consider using a merge field which would look something like:

           

          <<NameField>> <<SurNameField>> <<AgeField>>  (there is a space manually placed between each inserted merge field.

          • 2. Re: moving field content
            abitech
               I have to add this information to an existing container field that already contains some text. The idea would be to activate the script using a button, so that when the information in the fields becomes outdated, it can be manually moved to that other field that is some kind of a log.
            • 3. Re: moving field content
              LaRetta_1
                

              Why are you using a container field to hold any old data?  I suggest you use a regular text field so it can be easily searched if you want to find an old entry.

               

              Here is an example of adding a line to an audit log text field called AuditLog (placing the most recent at the top).  It includes the current date but you can omit that if you wish:

               

              Get ( CurrentDate ) & ": " & NameField & " " & SurNameField & " " & AgeField & ¶ & AuditLog

              ... when you click the button, the latest entry will appear at the top.

              • 4. Re: moving field content
                abitech
                  

                Sorry, I actually realized it is already a text field.

                 

                The first solution works very well, I only added the name of the target field to the calculation so that it adds it all up to the existing text, like this:

                 

                TargetField & " " & NameField & " " & SurNameField & " " & AgeField

                 

                The audit log idea might also turn useful. Thanks a lot for your help!

                 

                abitech