Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Search API > Methods

Search API: getSearchObject

Scroll Prev Next More

 

Gets the SearchClause object.

Syntax

 

 

getSearchObject(table)

 

or for tables added to the dashboard

 

getSearchObject(table, dashboard)

 

 

 

Arguments

table

the name of the table. You can either use table name like "Categories" or "dbo.Categories". Also in AfterTableInitialized event you can use table variable.

dashboard

the name of the dashboard.

Return value

Returns the SearchClause object.

Examples

 

This code should go to AfterTableInit event. If search is not started apply the initial search conditions and only show products that belong to Beverages category.

 

srchObj = SearchClause.getSearchObject("Products")
if not srchObj.searchStarted() then
  srchObj.setFieldValue("CategoryName", "Beverages" )
end

 

See also:

Example: Print search parameters on the List page

About Search API