10 Replies Latest reply on Jan 27, 2014 1:08 PM by SteveMartino

    Clear Multi Fields with one Button

    RehmanAkram

      Title

      Clear Multi Fields with one Button

      Post

           using FM pro Advanchere and i am begginer

           I have 3 fields

           1 = YES/NO Radio button

           2 = text field

           3 = Date field (setted up on modification ) also this field is inside the Text field

      I can clear text field with X clear Button, but i can not clear all with one button

      Button.jpg

        • 1. Re: Clear Multi Fields with one Button
          philmodjunk

               Use the perform script option to perform a script such as:

               Set Field [YourTable::Field1 ; "" ]
               Set Field [YourTable::Field2 ; "" ]
               Set FIeld [YourTable::Field3 ; "" ]

               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.

          • 2. Re: Clear Multi Fields with one Button
            FilmUser

                 Phil - just currious - why not the script option of "Clear", and select the field the same way? Seems simpler.

            • 3. Re: Clear Multi Fields with one Button
              philmodjunk

                   I don't see it as much simpler as you would need 3 clear steps in place of 3 set field steps, but such a script would work.

                   I prefer using set field over clear and the script steps that start with "insert" as those steps will silently fail to work if the field is not physcally present and accessible on the current layout at the instant the step is executed. Just using behavior settings to deny browse mode accesss is enough to keep those steps from working.

                   Thus Set Field works in situations where the alternatives do not and they are a percentage point or two less vulnerable to breaking due to some future modification of the layout.

                   PS. "Silently Fail" is my term for a script failure that generates an error code but does not interrupt the script with an error message to let you know that the error occurred. IMO, given the fact that you can't set up one "error handler script" to trap for and process script errors but have to test for them immediately after each step that might generate such an error is executed, this is not a good thing

              • 4. Re: Clear Multi Fields with one Button
                RehmanAkram

                     this is not working as i dont even know much about the Scripts if possiable please explain bit easy 

                • 5. Re: Clear Multi Fields with one Button
                  philmodjunk

                       Open Manage | Scripts.

                       Click New to start a new script.

                       Find the set field script step listed on the left of the script editor and double click it. Then follow the steps I posted earlier for setting up Set FIeld.

                       Repeat for each of the other two fields so that the result looks like my original post but with your field and table names in place of YourTable::Field1.

                  • 6. Re: Clear Multi Fields with one Button
                    RehmanAkram

                         here i have done that but still not working

                    • 7. Re: Clear Multi Fields with one Button
                      philmodjunk

                           You haven't followed my directions.

                           Each step must have this format:

                           Set FIeld [YourTable::YourField ; "" ]

                           The portion in Red is missing from each of the script steps.

                           And to add the missing "", you need to follow these instructions that I posted earlier:

                           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.

                      • 8. Re: Clear Multi Fields with one Button
                        RehmanAkram

                             Ooo My My GOD you are BEST ***Philmodjunk*** i can not belive I just did it by your instructions as i am a totally Noob beginner about the scripts and just did it Thanks guys you are AMAZING as always helps me out when i need it

                        • 9. Re: Clear Multi Fields with one Button
                          jmsver

                               Hi Phil,

                               I'm still a noob and struggling with this. I hope you don't mind revisiting this question. I'm trying to do the same thing (clear multiple containers at once, with a clear button). I've followed your instructions but I'm stuck as to what the function I should choose to clear the fields.

                          • 10. Re: Clear Multi Fields with one Button
                            SteveMartino

                                 Just type in the specify calculation box:

                                 ""    (2 quote marks)