Obsolete. Use SearchEngine instead.
Represents a generic database search. GenericSearch has less functionality for adding criteria than SearcEngine. The GenericSearch is originally made for searching and fetching data from the database. Thereby its name. GenericSearch is a tool for building up SQL queries, by adding fields and criteria.
GenericSearch extends theSearchEngine class with options for how to list fields. Displayfields, datafields, idfields. The fields must be given as starttablename.fieldname, for example “ticket.title” For tables that have foreign keys to other tables, you can reach them with starttablename.fieldname.fieldname
Make sure that all fields you use start with the same table, for example ticket, or else you will recieve a big join that you probably do not want.
For many-to-many relations there is a special notation: table1.(table2->field2a).field2b Where field2a is field in table2 that has a foreign key to table1.
Constructors
GenericSearch()
Initializes a new instance of the File class.
Methods
addComparison(String,String,String,String,Integer)
Adds a criteria between two database-fields to the database query.
Returns: CRMScript.Global.Void
addCriteria(String,String,String,String,Integer)
Add search criteria to the search.
Returns: CRMScript.Global.Void
The concatLevel specifies how this criteria will be concatenated with the rest of the query (parenthesis level). A higher concatLevel gives a ”(”, and a lower concatlevel gives a ”)“.
addField(String)
Adds a field to the queryAdds a field to be selected to the database query.
Returns: CRMScript.Global.Void
Use addField(String,Integer) to provide a field mask.
addField(String,Integer)
Adds a field to the queryAdds a field to be selected to the database query with a field mask.
Returns: CRMScript.Global.Void
addOrder(String,Bool)
Adds order on specified field, descending or ascending.
Returns: CRMScript.Global.Void
countRows()
Returns the number of rows in the result set.
Returns: CRMScript.Global.Integer - The number of rows in the result set.
eof()
Returns true if the result pointer has reached the end of result set, or false otherwise.
Returns: CRMScript.Global.Bool - True if the result pointer has reached the end of result set; otherwise, false.
execute()
Executes the query.
Returns: CRMScript.Global.Void
first()
Sets the result pointer to point at the first row in the result set.
Returns: CRMScript.Global.Bool - False if the result set is empty; otherwise, true.
get(String,Integer)
Retrieves the value of a field according to a field mask.
Returns: CRMScript.Global.String - The value of the field.
get(Integer,Integer)
Retrieves the value of a field according to a field mask.
Returns: CRMScript.Global.String - The value of the field.
next()
Sets the result set pointer to next row, returns </li></ul>
Returns: CRMScript.Global.Bool - True if there is a next row; otherwise, false (the pointer has reached the last result set)
setLanguage(Integer)
Sets what language to use when showing display fields.
Returns: CRMScript.Global.Void
setLimit(Integer)
Sets a limit of the number of rows that will be returned in the result set.
Returns: CRMScript.Global.Void