SetNamedSearch
Method
How to use SetNamedSearch method in the Siebel eScript ?
Example:
If the Siebel Administration logs into Siebel application
and click on the Contact Screen. It should only show the contacts who’s contact
method is E-mail.
For this requirement we can use SetNamedSearch method in
Business Component script.
Note: This requirement
is only for [Visible Contact List View].
- Login into Siebel Tools with SADMIN/SADMIN connecting for Sample database.
- Click on the Business Component in the Object Explorer.
- Query for a Contact Business Component and Lock the project.
- Use [ Alt + L ] to lock the project.
- Right click on the Business Component and Click on the Edit Server Script.
- Locate the following method. [BusComp_PreQuery ]
- Now write the following script to implement this requirement.
function BusComp_PreQuery ()
{
TheApplication().TraceOn("D:\Setname.txt","Allocation","All");
if(TheApplication().GetProfileAttr("Position")
== "Siebel Administrator")
{
TheApplication().Trace("Inside
f Block");
this.SetNamedSearch("EmailContacts"
, "[Preferred Communications] = 'E-Mail'")
}
TheApplication().Trace("View
Name : " + sActiveViewName);
TheApplication().Trace("Position
Name : " + TheApplication().GetProfileAttr("Position") );
TheApplication().TraceOff();
return
(ContinueOperation);
}
Explanation:
This.SetNamedSearch(ExprName,
“[fieldname] optr ‘value’ ”);
- Compile the BC and Test.