Posted by Vimarsh Ganju
Comments (1)
August 25th, 2008

Working with Siebel, I have come across many challenging requirements. Keeping in mind the Siebel Best Practices, the challenge gets tougher. In this post, I will share such a requirement.
The requirement was to put search specification in a Toggle Applet. Sounds very practical and easy but trust me it was not. About the toggle applet, Siebel Tools Help says:If two applets are defined with the same business component and both have a search specification, then the search specification for the applet in lowest sector is used.

Do not specify different search specifications where several applets in one view are based on the same business component. All of these applets should have the same or an empty search specification.

Going by the above mentioned documentation, I thought of two immediate approaches:

1. Copy the BC and Map one applet which is having the search spec.

I had already made a copy of the BC and creating a third copy, to map to the two given applets, was not an intelligent approach.

2. As per the Siebel Help content we can give the search specification in a form applet.

The Applets we were dealing with were List applets and not Form applets. So the second approach was not applicable either.

Hence the best alternative was to write a script which is as follows:

Set profile attrib in two applets when the user is going to toggle or executed query or SortAscending or SortDescending.


if (MethodName == “ExecuteQuery” ||  MethodName == “SortAscending” ||  MethodName == “SortDescending”)


TheApplication ().SetProfileAttr (“UserDoingQuery”, “Y”);


if (MethodName == “ToggleTo”)


TheApplication().SetProfileAttr(“Uni Tgt Team ToggledBackToAdmin”, “2”);



Use the same code as above and,

Set Profile Attribute as “Uni Tgt Team ToggledBackToAdmin” = 1.

In Event method of Business Component (BusComp_PreQuery   event)

Get the profile Attrib and give the search spec as per your requirement and clear the profile Attribute.

if ((TheApplication().GetProfileAttr(“Uni Tgt Team ToggledBackToAdmin”) == “2”) || (TheApplication().SetProfileAttr(“UserDoingQuery”) == “Y”))


this.SetSearchSpec (“Name”, “XYZ”);

TheApplication().SetProfileAttr (“Uni Tgt Team ToggledBackToAdmin”,””);


if ((TheApplication().GetProfileAttr(“Uni Tgt Team ToggledBackToAdmin”) == “2”) || (TheApplication().SetProfileAttr(“UserDoingQuery”) == “Y”))


this.SetSearchSpec (“Name”, “ABC”);

TheApplication ().SetProfileAttr (“Uni Tgt Team ToggledBackToAdmin”,””);


This script helped in enabling the search specification in a toggle applet. Hence, another challenging requirement was successfully met.

Inputs by Mahendran R

Comments (1)

pramod - October 17th, 2008

Hi, I got 4 toggle applet based on 1 BC, the requirement was if user select wrong toggle type and fill some fields and realized that he is on wrong toggle then he selects right toggle from dropdown..this time user dont want to save the data that he typed in first toggle. It would be great if somebody can help me on this. Thanks, Pramod

Comments are closed.