5 Replies Latest reply on Feb 21, 2014 6:53 AM by philmodjunk

    Automatic enter/return



      Automatic enter/return



           I am looking into the option of creating an archived notes section. So far I have a simple script that copies data from one field and pastes it into another.

           I have an issue whereby new data is added to the start of text already copied over. I have been able to get the text added to the top of the field by using the set selection and setting this to 0.

           My question is....Is there a way to automatically get the field to perform a return/enter to create a new space for new content, either by a script trigger "on object enter" / "on object exit" or by incorperating this into my current script?

           Many thanks,


        • 1. Re: Automatic enter/return

               No need for a script trigger.

               Set FIeld [Table::HistoryField ; List ( $NewTexthere ; Table::HistoryField ) ]

               Will insert new text at the top of the text field with a return between it and the original text in the field.

               But this sounds like data that would be better structured by logging each such entry in it's own record instead of cramming it all into a single field.

               (And I suspect from your word choice that you are using copy/paste to move this data. That's not the best way to do it. Using Set variable instead of copy and set field instead of paste is a much better option. It avoids confusing/irritating your user when data they previously copied to the clip board remains unmodified instead of changing to the text your script is copying.)

          • 2. Re: Automatic enter/return

                 Hi Phil,

                 Thanks for you reply.

                 Would you be able to show me what the script should look like if I don't use the copy and paste function?

                 Ideally I want the data entered in d__Info to be automatically stored in d__Info Archived.

                 Many thanks for your time.




            • 3. Re: Automatic enter/return

                   are d_info and d_info two fields defined in the same table? If not what are the table names and how are they related?

              • 4. Re: Automatic enter/return

                     Yes they are part of the same table

                • 5. Re: Automatic enter/return

                       Then you don't need set variable.

                       Set Field [ YourTable::d__Info Archived ; List ( d__Info Archived ; d__Info ) ]

                       When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                       But please note that I have recommended that you not cram all of this data into a single field. Instead it would be better to set up a related table of these values and add a new record each time.