7 Replies Latest reply on Oct 18, 2013 8:08 AM by philmodjunk

    Copy and paste

    DavidDicken

      Title

      Copy and paste

      Post

           Okay so I think I wrote a script which is

           SetError capture [on]

           Copy [Select; Inv|New Parts::Inventory Adjusted]

           Paste [Select; Inv|New Parts::Returned]

           and this kinda works except I have to actually click in the returns field to make any thing happen. So how do I let FMP know that something has been entered and it's okay to run the calculation and not have to actually have to click in the field?

        • 1. Re: Copy and paste
          philmodjunk

               I don't see, from your post, why you would need to click in the returns field to make this happen, but Copy/Paste should not be used in a script for this purpose. When copy is executed, it replaces any data the user may have copied to the clipboard with data copied from Inventory Adjusted. This can confuse and irritate your users and is easily avoided with other script steps.

               Set Field [Inv|New Parts::Inventory Adjusted ; Inv|New Parts::Returned ]

               can be used in place of copy/paste, is one step instead of two and leaves any data in the clipboard untouched.

          • 2. Re: Copy and paste
            DavidDicken

                 okay so I tried the set field and it does not populate the returns field. so the returns field won't calculate. but it does work when I use the copy and paste. I also set a script trigger to on commit and I don't have to click in the returns field for it to function. However I would really like to use the set field option,  it does seem to a be better all around if I could get it  to work. I am using FMP 11A

            • 3. Re: Copy and paste
              philmodjunk

                   Set field must not be correctly set up. it should look exactly like I posted. If you see some extra brackets, it's not set up correctly.

                   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.

              • 4. Re: Copy and paste
                DavidDicken

                     First off thanks for all your help. I really appreciate it.

                     Okay Here's the script I tried to use obviously the copy & paste are disabled here, does that effect how the set field should work?  Does it look correct to you? 

                • 5. Re: Copy and paste
                  philmodjunk

                       I can't read your script even when I zoom in. But what I can see does not look like the copy and paste steps are disabled.

                       Rather, it looks like set field is disabled.

                  • 6. Re: Copy and paste
                    DavidDicken

                         Okay. Here it is. You were right the print screen I did had the copy and paste enabled and the set field disabled however this is how I tried to use the set field and no data is put into the returned field. So I'm not sure why or what I've done wrong.

                           Set error Capture {On}

                         // Copy [Select; INV|NEW Parts::Adjusted]

                         //Paste [Select; INV|NEW Parts::Returned]

                         Set Field [INV|NEW Parts::Inventory Adjusted; INV|NEW Parts::Returned]

                          

                    • 7. Re: Copy and paste
                      philmodjunk

                           IF the copy and paste worked, then the set field should work also. This is the standard method from moving data from one field to another.

                           Errors I have seen before:

                           Set Field [INV|NEW Parts::Inventory Adjusted  [INV|NEW Parts::Returned] ]----> second parameter is entered in Repetition box.

                           Set field by Name [INV|NEW Parts::Inventory Adjusted; INV|NEW Parts::Returned]---> wrong script step