ClearToQuery Method
The ClearToQuery method clears the current query. It returns nothing. It uses the following syntax:
BusComp.ClearToQuery();
It includes no arguments.
Note the following:
The ClearToQuery method does not clear the sort specification that Siebel Open UI defines in the Sort Specification property of a business component.
You must use the ActivateField method to activate a field before you can use the ClearToQuery method. For more information see ActivateField Method.
Any search specifications and sort specifications that Siebel Open UI sends to a business component are cumulative. The business component performs an AND operation for the queries that accumulate since the last time Siebel CRM performed the ClearToQuery method. An exception to this configuration occurs if Siebel Open UI adds a new search specification to a field, and if this field already includes a search specification. In this situation, the new search specification replaces the old search specification.
Example
The following example uses the ClearToQuery method:
var model= SiebelApp.S_App.GetModel();
var oEmpBusObj= model.GetBusObject("Employee");
var oEmpBusComp = oEmpBusObj.GetBusComp("Employee ");
var sLoginName;
oEmpBusComp.ClearToQuery();
oEmpBusComp.SetSearchSpec("Login Name", sLoginName);
oEmpBusComp.ExecuteQuery();
For another example usage of the ClearToQuery method, see CountRecords Method.