Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
id0

Search pages are XML files used to search for certain information, based on certain criteria, and can be used in both summary and data entry pages.


What does this section cover?

Table of Contents

Creating Search Pages

To create a new search page, you need to create a single XML file under: ../pages/search/<module_name>/ directory. 

The results are retrieved based on an SQL script constructed using the information from the XML file and the criteria entered by the user.


In the following example loadservices.xml is created under ../pages/search/products

Ui expand
titleSearch Services Example


Code Block
languagexml
themeEclipse
firstline1
titleloadservices.xml
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="UTF-8"?><dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/search.xsd">
	<searchcaption>key_search_services</searchcaption>
	<sqltype>Select</sqltype>
	<entitytable>PRODUCTS</entitytable>
	<entityfield>PRODID</entityfield>
	<tables>
		<table><tablename>PRODUCTS</tablename></table>
		<table><tablename>PRODUCTTYPES</tablename></table>
		<table><tablename>PRODUCTBRANDS</tablename></table>
		<table><tablename>PRODUCTFAMILIES</tablename></table>
	</tables>
	<joins>
		<join>
			<indexorder>1</indexorder>
			<outertable>PRODUCTS</outertable>
			<innertable>PRODUCTTYPES</innertable>
			<jointype>RIGHT</jointype>
			<conditions>
				<conditionitem>
					<outerfield>PRODTYPEID</outerfield>
					<condition>=</condition>
					<innerfield>PRODTYPEID</innerfield>
					<andor>AND</andor>
				</conditionitem>
			</conditions>
		</join>
		<join>
			<indexorder>2</indexorder>
			<outertable>PRODUCTS</outertable>
			<innertable>PRODUCTBRANDS</innertable>
			<jointype>LEFT</jointype>
			<conditions>
				<conditionitem>
					<outerfield>PRODBRANDID</outerfield>
					<condition>=</condition>
					<innerfield>PRODBRANDID</innerfield>
					<andor>AND</andor>
				</conditionitem>
			</conditions>
		</join>
		<join>
			<indexorder>3</indexorder>
			<outertable>PRODUCTS</outertable>
			<innertable>PRODUCTFAMILIES</innertable>
			<jointype>LEFT</jointype>
			<conditions>
				<conditionitem>
					<outerfield>PRODFAMILYID</outerfield>
					<condition>=</condition>
					<innerfield>PRODFAMILYID</innerfield>
					<andor>AND</andor>
				</conditionitem>
			</conditions>
		</join>
	</joins>
	<fields>
		<fielditem>
			<field>PRODUCTS.PRODID</field>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>0</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<indexorder>10</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODCODE</field>
			<label>key_product_code</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<indexorder>20</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODTYPEID</field>
			<label>key_product_type</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<lookup>dataset;products.loadtypes;prodtypeid;prodtypename</lookup>
			<indexorder>30</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODFAMILYID</field>
			<label>key_product_family</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<lookup>dataset;products.loadfamilies;prodfamilyid;prodfamilyname</lookup>
			<indexorder>40</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODBRANDID</field>
			<label>key_product_brand</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<lookup>dataset;products.loadbrands;prodbrandid;prodbrandname</lookup>
			<indexorder>50</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODALTCODE</field>
			<label>key_alternative_code</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<indexorder>60</indexorder>
		</fielditem>
		<fielditem>
			<field>PRODUCTS.PRODDESC</field>
			<label>key_description</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>255</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<indexorder>70</indexorder>
		</fielditem>
	</fields>
	<wheregroups>
		<wheregroup>
			<wherefields>
				<wherefield>
					<field>PRODUCTS.PRODDELETED</field>
					<alias>Expr001</alias>
					<expression>VALUE</expression>
				</wherefield>
				<wherefield>
					<field>0</field>
					<alias>Expr001</alias>
					<expression>VALUE</expression>
				</wherefield>
			</wherefields>
			<wheremembers>
				<wheremember>
					<lparenth>0</lparenth>
					<lfield>PRODUCTS.PRODDELETED</lfield>
					<expression>=</expression>
					<rfield>0</rfield>
					<rparenth>0</rparenth>
					<andor>AND</andor>
				</wheremember>
				<wheremember>
					<lparenth>0</lparenth>
					<lfield>PRODUCTTYPES.PRODTYPECLASSIFICATION</lfield>
					<expression>=</expression>
					<rfield>'SERVICES'</rfield>
					<rparenth>0</rparenth>
					<andor>AND</andor>
				</wheremember>
			</wheremembers>
		</wheregroup>
	</wheregroups>
	<groupby/>
	<orderby/>
</dataset>


Expand
titleSearch Services Page

Image Added





For more information on customising search pages, go to Customize Search Pages. For a full list of search page attributes, go to Search Pages Documentation.

To continue implementing the view layer, go to Developing summary pages (Deprecated)