3 Replies Latest reply on Feb 16, 2010 11:32 AM by philmodjunk

    Multiple find using several globals (scripts)

    kilbot

      Title

      Multiple find using several globals (scripts)

      Post

      This is the script that I'm using below, however something is wrong. I have several global fields and would like to perform a find. If there is no data in the first global field I would like it to go on to the next global field in the script. If there is data in both globals then I would like it to look for both. Hope someone can help thanks.

      #
      Go To Layout ["Table View DBE"(DBE Listing)]
      Set Error Capture [On]
      #
      Enter Find Mode []
      Set Field [ DBE listing::g_Business_Firm_ID; DBEListing::Firm ID]
      New Record/Request
      Set Field [ DBE listing::g_Business_Name_Firm; DBEListing::Business_Name_Firm]
      Perform Find []
      #
      #// Check result and if no records found alert user.
      If [ Get ( FoundCount ) = 0 ]

      Show Custom Dialog ["Message" ; "No Records Found."]
      Go To Layout ["Form View CEU"(Contract Management)]
      Enter Browse Mode []

      End If
      #










        • 1. Re: Multiple find using several globals (scripts)
          philmodjunk
            

          If g means Global field, then I believe your script should read:

           

          Set Field [ DBEListing::Firm ID ; DBE listing::g_Business_Firm_ID]
          New Record/Request
          Set Field [ DBEListing::Business_Name_Firm ; DBE listing::g_Business_Name_Firm]

          • 2. Re: Multiple find using several globals (scripts)
            kilbot
              

            Okay but I am placing the info into the global

             

            example 

             Firm 1222 (this is the global field that I place what I am looking for)

             

            Then I want it to take me to the Firm_ID field and show the information for that field.

             

            If the field is empty

              then I want it to go on to the next global

             

            Business address:  1345 1st street

             

             

            I tried it the way you said but it did nothing, I can get this to run with ine global but not multiple searches.

            • 3. Re: Multiple find using several globals (scripts)
              philmodjunk
                

              You can't modify a global field in find mode nor can you search on a global field to find records. Try this by entering find mode with a layout that shows a global field. You'll find you can't enter data into the field.

               

              Normally, the user enters search text into a global and then the script uses the contents of the global fields to construct a find request or two.

               

              In your case, no globals should be needed at all. Use variables.

               

              Set variable [$Firm ; Value : DBEListing::Firm ID]

              Set Variable [$Bname ; Value : DBEListing::Business_Name_Firm]
              Go To Layout ["Table View DBE"(DBE Listing)]
              Set Error Capture [On]
              #
              Enter Find Mode []
              Set Field [ DBEListing::Firm ID ; $Firm]
              New Record/Request
              Set Field [  DBEListing::Business_Name_Firm ; $BName]
              Perform Find []

              You can also use global fields if you want. Just set the values before you enter find mode.