4 Replies Latest reply on Mar 5, 2014 11:39 AM by MehrdadBastan

    Script to perform find

    MehrdadBastan

      Title

      Script to perform find

      Post


           Hi Friends

           I am a novice and using FM 12, I really need your help.

           I created a database to record the calls we make to the customer to get some data for the Photo shoot. (Some of these records are already my customers and some are not)

           Fields

           CustomerID (Serial Number)

           Customer Name (Text)

           My Clients (Text) Radio Butons

             
      •           Yes
      •      
      •           No

            

           Shoot Date (date Field)

           Data Acquisition (Text Field) with 4 Radio buttons

             
      •           -Not Done
      •      
      •           -Call Back
      •      
      •           -Waiting
      •      
      •           -Completed

           I need to perform find & list  My Clients that are not completed and sort them by the shoot date.

           How do  write this script? I appreciate any help

           Thanks

            

        • 1. Re: Script to perform find
          philmodjunk

               Enter Find Mode [] ----> clear the pause check box
               Set Field [ YourTable::Data Acquisition ; "completed" ]
               Omit Records ---> this makes this an "omit request", find all records where the "completed" check box is not selected
               Set Error Capture [on]
               Perform Find []
               Sort Records [Restore ; No dialog ] ----> specify sorting on the shoot date field here

               For more examples of scripted finds of this format, see: Scripted Find Examples

               Note: 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: Script to perform find
            MehrdadBastan

                 Thanks for your quick response Phil

                 However this script brings up all the customers and not the ones marked as My Clients. I also would like to make sure if the shoot date is empty the client doesn't show up in the list

                 Thanks Again

                 Mehrdad

            • 3. Re: Script to perform find
              philmodjunk

                   Enter Find Mode [] ----> clear the pause check box
                   Set Field [YourTable::My Clients ; "Yes" ]
                   Set Field [YourTable::Shoot Date ; "*" ]
                   New Record/Request
                   Set Field [ YourTable::Data Acquisition ; "completed" ]
                   Omit Records ---> this makes this an "omit request", find all records where the "completed" check box is not selected
                   Set Error Capture [on]
                   Perform Find []
                   Sort Records [Restore ; No dialog ] ----> specify sorting on the shoot date field here

              • 4. Re: Script to perform find
                MehrdadBastan

                     Thank you so much for your help. I love this forum