Navigation:  Software Configuration Tab >

Searches by Query

Previous pageReturn to chapter overviewNext page

One of the most powerful features within HireTrack NX is the ability for the user to control the searches and the Predefined Views. These searches appear in multiple places, including

The Job Book
The Warehouse Book
The CRM Module
The Projects Book

 

SearchbyQBE1

Examples of Searches in HireTrack NX

 

All the searching and predefined views in HireTrack NX are controlled through the Searches book within the Software Configuration area.

 

NOTE: The searches with the grey background are "System" entries, which means that it cannot be edited and it is a "template" that you can either use "as if" or from which you can derive other Queries. We want to do that latter so we will CLONE this entry using the "Queries | Clone QBE" menu. Once cloned give the new QBE a new name.

 

 

SearchbyQBE2

 

This will open the QBE book in a special mode. Looking at the Search Jobs Query, we will clone this Query.

 

We then need to Edit this cloned Search QBE, so change to the Editor Tab.

 

We want to add Site information so we need to know something about the Sites table.

By looking at the existing QBE, we can see that the Sites table is linked to the Jobs tables by the field PrimarySite and IDX.

 

SearchbyQBE3

 

 

 

This gives us enough information to realise that we need to filter the Jobs table using the PrimarySite field and the value for that field can be found from the Sites table - the numeric value of PrimarySite is reflected in the numeric value of the Sites table IDX field. Of course presenting the use with a numeric value isn't very friendly, so we want the name of the site, which we can see is the field SiteName.

 

Now we have this information, we can add the PrimarySite filter option to our QBE.

 

To do this, simply check the checkbox on the line showing PrimarySite and it will be added to the bottom of the grid QBE grid.

 

SearchbyQBE4

 

 

Uncheck the Output checkbox, which is automatically checked when we add a new field - we don't want the PrimarySite field (the numeric value) displayed to the user.

 

We now need to tell the QBE engine to ask the user for some input to select the Site. We do this in the Criteria column of the QBE grid. If you look at some of the other criteria, you'll see that they're made up of code such as

 

    = :Handler$Users$UserName$UID Or :Handler$Users$UserName$UID Is Null

 

This can be explained as

 

: - Code to inform the software that we need to prompt the user for some input
Handler - The text that will prompt the user for input. i.e this will ask the user for the Handler info
$ - a delimiter character
Users - The TABLE that will provide the data to present to the user
$ - a delimiter character
UserName - The data field that will be presented to the user to make their selection
$ - a delimiter character
UID - The field that contains the data used for the filter - usually the key index field of the provider TABLE.

 

 

The OR signifies an alternative condition and the IS Null signifies if nothing is selected, thus the above line will present the users with a dropdown list of UserNames and it will filter the Jobs table based on Handlers that match the selected UserName. If no UserName is selected, then it will select ALL handlers.

 

To filter on Sites, looking at the Sites table in the QBE we can see that we need code like

 

  = :Site$Sites$SiteName$IDX Or :Site$Sites$SiteName$IDX Is Null

 

in other words, filter the jobs table ask the user to select a Site by giving the user a dropdown which displays the SiteName.

 

Thus the final line of the QBE grid becomes

 

SearchbyQBE5

 

Press the SAVE button, and all is done.However, you may not longer wish to see the original "system" Search Jobs QBE on the list of Views available for the Job Book, in which case, go back to the Search Jobs QBE and uncheck the "Published" option and then SAVE.

 

We should now be able to open the Search form for Jobs and search the new view that we have created and it should contain the the new criteria Sites and the drop down lists all the sites.

 

SearchbyQBE6