You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 31
Next »
Search pages are the XML files that contain database query definitions.
What does this section cover?
Attributes
| | |
---|
searchcaption | A title which is displayed on the screen. | Any |
sqltype | The type of SQL script. | SELECT or SELECT DISTINCT |
tables | A list of tables to be used in the joins and fields sections. | Any table name that exists in the database |
joins | A list of elements to join the tables. | Join |
fields | The fields that are used in the select and where clauses. | Field Item |
wheregroups | A wheregroup groups together where conditions in the search file. | Wheregroup |
groupby | Collects data across multiple records and groups the results by one or more fields. | Any field name |
orderby | Sorts the query result set based on one or more fields. | Order By |
classname | The name of the EJB class containing the EJB method that is called to load the search results. | Valid EJB class name |
methodname | The EJB method that is called to load the search results. | Valid EJB method name |
Example
Search Page using SQL function
<?xml version="1.0" encoding="UTF-8"?>
<dataset xmlns="http://www.crm.com/xmlschema/dataset.rng">
<searchcaption>key_serch_products</searchcaption>
<sqltype>Select</sqltype>
<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>1</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>2</indexorder>
</fielditem>
...
</fields>
<wheregroups>
<wheregroup>
<wherefields>
<wherefield>
<field>PRODUCTS.PRODDELETED</field>
<alias>Expr001</alias>
<expression>VALUE</expression>
</wherefield>
<wherefield>
<field>0</field>
<alias>Expr002</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>
</wheremembers>
</wheregroup>
</wheregroups>
<groupby/>
<orderby/>
</dataset>
Search Page using EJB method
<?xml version="1.0" encoding="UTF-8"?><dataset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/search.xsd">
<searchcaption>key_priority_level</searchcaption>
<classname>ejb/CRMUIServiceRequest</classname>
<methodname>getPriorityLevels</methodname>
<fields>
<fielditem>
<field>priorityLevelId</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>priorityLevelName</field>
<label>key_priority_level</label>
<expression>VALUE</expression>
<datatype>ftXString</datatype>
<fieldlen>32</fieldlen>
<searchcriteria>1</searchcriteria>
<visible>1</visible>
<executable>1</executable>
<indexorder>20</indexorder>
</fielditem>
</fields>
</dataset>