Versions Compared

Key

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

Search XML Files (Datasets)

Datasets are used to search for information based on certain criteria stated in the search XML file.

DatasetImage Added

Creating the Search XML (Dataset) Files

To create a new dataset, we need to create a single XML file. Based on the business structure, the respective directories should be created. Based on CRM.COM naming conventions, all datasets are stored in the ../pages/search/<module_name>/ directory. An SQL determines the information that will be retrieved and specified fields will be able to be displayed and/or searched for. 

 

In this case, we create a directory named ../pages/search/inventory and then we create a new XML file named loadwarehouses.xml

Code Block
languagexml
titleloadwarehouses
<dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/search.xsd">
	<searchcaption>Search Warehouses</searchcaption>
	<sqltype>SELECT</sqltype>

	<tables>
		<table><tablename>WAREHOUSE</tablename></table>
	</tables>

	<joins/>

	<fields>
		<fielditem>
			<field>WAREHOUSE.WRHID</field>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>32</fieldlen>
			<searchcriteria>0</searchcriteria>
			<visible>0</visible>
			<executable>1</executable>
			<indexorder>1</indexorder>
		</fielditem>

		<fielditem>
			<field>WAREHOUSE.WRHNAME</field>
			<label>Name</label>
			<expression>VALUE</expression>
			<datatype>ftXString</datatype>
			<fieldlen>100</fieldlen>
			<searchcriteria>1</searchcriteria>
			<visible>1</visible>
			<executable>1</executable>
			<indexorder>2</indexorder>
		</fielditem>
 
		...
 
	</fields>

	<wheregroups>
		<wheregroup>
			<wheremembers>
				<wheremember>
					<lparenth>0</lparenth>
					<lfield>WAREHOUSE.WRHDELETED</lfield>
					<expression>=</expression>
					<rfield>0</rfield>
					<rparenth>0</rparenth>
					<andor>AND</andor>
				</wheremember>
			</wheremembers>
		</wheregroup>
	</wheregroups>

	<groupby/>

	<orderby/>

</dataset>