Tuesday, August 31, 2010

Making buttons/Controls invisible

Sometimes greatest treasures are those which are invisible to eyes. Hiding controls at runtime could be fun and at times very useful.This may help in avoiding creation of multiple applets. Recently i came across a scenario where in one view user was allowed to perform some operation on button click while in other views he should not see buttons. One approach is to have applet Base mode defined in the other view w/o buttons but it fails when mulitple toggles are defined in the applet and applet defined in view is of mode type "Edit". Other option is to make controls invisible. Following code could be useful for making buttons hidden in Form Applet dynamically based on the View type. Again Browser Script is our friend.

function Applet_Load()
{
var sView = theApplication().GetProfileAttr("ActiveViewName");
switch(sView)
{
case "Activity Attachment View":
var ctrlSubmit = this.FindActiveXControl("Submit"); // This is the name of control
ctrlBack.style.visibility = "hidden";//Setting visibility property to hidden
break;
}
}

Siebel give capabilities that our own Mr India will be proud of!!!

Thursday, August 19, 2010

Fetching ASCII Code

The key to the most generic character encoding scheme is ASCII. I am sure many of us at some point of time have land up in situation where the ASCII representation is desired. It is must in scenarios while playing with bitwise operators for calculations. Siebel also gives us function which returns ASCII value for any character.
Function:
stringVar.charCodeAt(indexVar)

Example:
var sEnCode = "ABCDEFGH";
var sGetCode = sEnCode.charCodeAt(2)
This will return 67 as output as ASCII representation for C character is 67. More of this function is available on siebel support under document ID 513659.1

Sunday, August 15, 2010

Navigating Backward

Going back was never so easy. Siebel makes use of underline javascript functions to go to previous page. It can come handy in many scenarios. Following code could be used on browser side of applet for going backward.

if(name == "Back")
{
history.go(-1);
return ("CancelOperation");
}

Or

if(name == "Back")
{
window.history.back(-1);
return ("CancelOperation");
}

There are multiple ways to achieve this. Some of the OOB business services which could be used to achieve this are "CUT eSales Order Entry Toolkit Service" or "FINS Goto View Service" which has got "GotoView" method which can be used to navigate to destination while maintaining the context.

simply siebel !!!

Friday, August 6, 2010

Bulk Symbolic Strings Creation

Siebel is like an ocean, everyday i learn something new. We all have worked with Symbolic Strings. "Symbolic Strings" are key while configuring Multilingual environment. But at times most of us land up creating "String Override" instead of creating "String References". Same scenario happened with me before i realized it was too late for me to go back and create Symbolic Strings for each applet titles and display Columns. It can be very tidious task to create symbolic strings manually and assigning them to respective columns when the list is huge.

Siebel again came to resuce and after some analysis i found there is a utility in siebel which could be used to generate Symbolic Strings in bulk. Yes Siebel can do it for you.

"strconv.bat" is the Magic Wand here. This batch files is located in the siebel installables folder under Bin. This file basically works in two steps:

1 - It creates list of items which needs to be regrouped for Symbolic string generation for a specified Object type like Applet, List Column or Control.This is export operation.
2- Next step is import operation. In this it creates Symbolic Strings for above exported items in tools and adds references to the symbolic strings on the original exported items.

This batch file is self explanatory and lists the syntax and paramters required to run.Before we start any operation, Following parameters are required to be changed in this batch file.(Before you start take a backup of this batch file...:) )

REM * Parameters used on both export and import
set TOOLS_INSTALL=C:\Program Files\Siebel\8.0\Tools\BIN
set CONFIG_FILE=C:\Program Files\Siebel\8.0\Tools\BIN\ENU\tools.cfg
set TEST_LOCATION=D:\SS
set REPOSITORY=Siebel Repository
set LANG=ENU
set SPLIT_FILE=false

REM * Parameters used on conversion export
set MATCH_MIN=1
set EXCLUDE_NULL=true
set USE_FULL_MATCH=true
set USE_EXACT_MATCH=false
set SKIP_INACTIVE=true

REM * Parameters used on conversion file split
set FILE_SIZE=1000

REM * Parameters used on conversion import
set PROJECT=Test Project
set SKIP_UPDATE_PARENTS=true
set LOG_ERROR_RECORDS=true
set UNLOCK_PROJECTS=false
set DELETE_LOCALES=true
set CHECK_TRANSLATE_FLAG=true

If the number of items for conversion is very large then SPLIT_FILE feature could be used to split files based on FILE_SIZE number. Once parameters are set this file is ready to run. Lets consider we want to generate Symbolic Strings for Applet in siebel Repository. Go to command propmpt and run this batch file with following options:

strconv "Applet" export

This will generate two files in log folder:

Applet_export.log
Applet_conversion.txt

Verify the log file whether records are exported correctly. Once the export is done successfully. Run following import command:

strconv "Applet" import

This will generate two files in log folder:

Applet_import.log
Applet_import.log.txt

Once this operation is completed log in to Siebel tools to verify whether Symbolic strings are generated and Override strings have been removed. The crux of this batch file is "consoleapp.exe" which basically performs import and export operation which is also located under Bin folder. I hope this helps you in generation of Symbolic strings in bulk.

Tuesday, August 3, 2010

Multiple Drill-downs

Many of us have configured drilldowns in our project and as a deliverable there are scenarios also when we have to capture Drilldown method. This can be easily done by trapping Drilldown method at applet level using "Drilldown" method. However complexity comes when we have multiple drilldowns defined on the applet and we need to capture any particular drill-down field for processing. But Siebel always spring something as life saver. We can capture the drilldown for any particular field using "SWEField" property which comes as input property. Each mapped field have a unique identifier which can be used in drilldown method to check desired field.

First lets try to fetch the SWEField id for any desired drilldown field. I am still not able to figure out how siebel generates this tag, any help on this will be really great. This sample code on browser side helps in fetching the SWEField tag for any field in applet on Drilldown method.

function Applet_PreInvokeMethod (name, inputPropSet)
{
if(name == "Drilldown")
{
alert(inputPropSet.GetProperty("SWEField"));
return ("ContinueOperation");
}
return ("ContinueOperation");
}

There are two drilldowns configured in the below applet Reference and Assigned To.On click of Reference of first record it displays "s_4_2_26_0" .


On click of Reference of second record in list itAdd Image displays "s_4_2_26_1".




The last number is always incremented by one as we traverse through record set.Similarly on click of Assigned To on first record it displays "s_4_2_67_0" .


on click of second record it displays "s_4_2_67_1".



Lets consider now we want to trap drilldown only on reference field. This can be achieved by using following code:

function Applet_PreInvokeMethod (name, inputPropSet)
{
if(name == "Drilldown" )
{
if(inputPropSet.GetProperty("SWEField").indexOf("s_4_2_26") >= 0)
alert("Siebelish");
return ("CancelOperation");
}
return ("ContinueOperation");
}

But how siebel generates these SWE tags for fields is still a mystery for me. Happy Hunting!!