1 Reply Latest reply on Oct 21, 2009 12:27 PM by philmodjunk

    Auto Delete Find Field

    anicolais

      Title

      Auto Delete Find Field

      Post

      The Company_Seacrch_Company field is a field on my layout that the user enters a company name into and clicks the find button next to it which executes the script below. How would I make this script also go back the the orignial record and delete the text in the field Comapny_Search_Company automatically while still executing the search afterwords. The problem I am having is that the original record that the user enters the info into retains this information which makes it confusing for the next user that decides to do a search from this record. (ex. generally the first record in my database has abotu 10 company names in the Company_Search_Company field becase the user doesnt understand they have to delete the field before trying to search for a different company.)

       

      Set Variable [$ID; Value:Company::Company_Search_Company]

      Enter Find Mode []

      Set Field [Company::Company;;Company_Name; $ID]

      Perform Find[]

      If[Get(FoundCount) = 0]

      Go to Layout [original layout]

      Show all Records

      End If

        • 1. Re: Auto Delete Find Field
          philmodjunk
            

          Set Variable [$ID; Value:Company::Company_Search_Company]

          Set Field [Company::Company_Search_Company; ""]

          Enter Find Mode []

          Set Field [Company::Company;;Company_Name; $ID]

          Perform Find[]

          If[Get(FoundCount) = 0]

            Go to Layout [original layout]

            Show all Records

          End If

           

          Is one method. An even better way might be to make Company_Search_Company an global field. If hosted over a network the global field will revert back to its original (blank if you set it up this way) value when the user closes the database and changes made to the field by one user will not be visible to another.

           

           

          Enter Find Mode []

          #This only woks if Company_Search_Company is a global field

          Set Field [Company::Company;;Company_Name; Company::Company_Search_Company]

          Perform Find[]

          If[Get(FoundCount) = 0]

            Go to Layout [original layout]

            Show all Records

          End If