2 Replies Latest reply on Apr 16, 2009 4:51 AM by Orlando

    record search



      record search


      Hi Group


      Is there a way to search all data on a form (all field boxes) for criteria entered in a single field box?





        • 1. Re: record search
             You can use the "Find/Replace" menu item from the Edit menu.  Enter the search text and click the "All records" and "All fields"
          • 2. Re: record search

            Hi fluffy


            This can be done using a script and a loop, but you will need to make sure that all the fields you want to search on, and only the field you want to search on, are in the layouts tab order. So you might want to setup a separate layout to perform the search, but the user will not notice any change.


            Once you have set all the field in the tab order you need to set up the script to perform the search, I will assume for this that the field the user inputs the search criteria into is called gSearchField, and is set to be a global.


            The script will go like this:


            Set Error Capture [On] 
            Set Variable [ $SearchCriteria; TABLE::gSearchField ] 

            Go to Layout [ “SearchLayout” ] 
            Enter Find Mode [ ]  // Deselect 'Pause' 
            Set Variable [ $StartingField; Value:Get ( ActiveFieldName ) ] 
            Go to Next Field 
            Set Field [ $SearchCriteria ] 
            Exit Loop If [ Get ( ActiveFieldName ) = $StartingField ] 
            New Record/Request 

            End Loop 
            Perform Find [ ]
            Go to Layout [ “OriginalLayout” ] 

            #// Check result and if no records found alert user.
            If [ Get ( FoundCount ) = 0 ]
            Show Custom Dialog ["Message" ; "No Records Found."]
            Enter Browse Mode []
            End If 


            And then you run this after the user inputs a search criteria in the gloabal.


            Let me know if anything is unclear and I will expand upon it for you.