Sunday, December 9, 2012

Standard Interactivity or High Interactivity

With winters approaching hibernation starts and efficiency dips (even though its below par through out the year). But still issues never stop. Recently while working on standard interactivity portal we have written script on BC which was used in both HI as well as SI application. However typical business requirement forced us that this piece should be executed only on SI mode of the application and not on the HI mode.

The real trick here is to identify in which mode of application you are working on. With some support from Google we were able to find its-another-mystery-service-type business service which is used extensively but less talked about. "Web Engine State Properties" is the magic service here. Below piece of code can help you find the mode.

var sInputs = TheApplication().NewPropertySet();
var sOutputs = TheApplication().NewPropertySet();
TheApplication().GetService("Web Engine State Properties").InvokeMethod("IsHighInteractive",sInputs,sOutputs);
var sTest = sOutputs.GetProperty("IsHighInteractive");

The key here is the name of the method and name of output argument is same. There are more methods of this BS. All will return either 1 or 0. This BS is primarily used in SWT tags to determine modes, main example being CCStylesChoice.swt where it directs which CSS file to be used for which mode. Any other method to identify application mode is more than welcome in comments section.

Happy Crunching!!





Tuesday, November 13, 2012

Happy Diwali!!

Troubles as light as Air
Love as deep as Ocean
Friends as solid as Diamonds
And Success as bright as Gold
These are the wishes for you
And your family on this festive season...






Tuesday, October 23, 2012

Symbolic String Locator


As an addendum to my previous post here i publish a mini symbolic string locator. It can help you to identify at what all places any particular symbolic string is being used. As a part of beta release it searches only at the Applet(List + Control) level. It is available in Downloads section also.

This can be of real help in scenario when you are asked to modify any existing symbolic string value and you have to look at objects to compile. The advantage of this tool is you don't have to open any sort of siebel client on your machine while running it. Only you have to remember the DSN name, the one given in the CFG for local client. It takes two parameter as input.

Local DSN = The DSN name of your siebel local client and Username/Password.

Symbolic String = The symbolic string to search.

The Objects sheet gives you flexibility to search the limited objects. The output for each object type is captured in respective object sheet.  If it errors out after giving correct DSN name make sure you have selected "Microsoft ActiveX Data Objects Library"  in your excel references. Once again valuable inputs/suggestions/comments are always welcome.


Happy Crunching!!

Monday, October 15, 2012

Symbolic String Compilation

Issues are multifaceted. They can teach and piss you off at the same time.

Recently we faced a simple-cum-silly issue while changing the symbolic string. I have modified the string value of existing string but to my surprise the new value was not getting reflected in the applet. It is only after the compilation of Applet,where this symbolic string is being used, changes were reflected. This is because objects may store the string name rather reference.

Ideally the compilation of symbolic string should have sufficed but unfortunately we have to compile all the underline objects where it is being used in order to confirm the change.


This gives rise to bigger question how to know at what all places any particular Symbolic String is being used. Repository search can aid but again it can force you to wait for ages. I am in process of creating a tool which will take any Symbolic String as Input and will list all the objects where it is being used. Hope to put for global audience for comments soon.

Happy Crunching!!

Monday, September 10, 2012

Profile Hunter 1.0


Off lately i have been involved in the training and knowledge transfer sessions so delay in writing post. Trust me training is definitely not the best part of job. In one of the sessions i was asked a scorcher of question.

Is it possible to find all the places where we have used any profile attribute including tools and client side artifacts ?


This prompted me to learn some excel vb and i have come up with an alpha profile hunter tool which guns down profile attributes used in client side artifacts. This tool is available for you for download and trial. It is also available under Downloads link.It takes profile attribute you have specified and searches this attribute in below objects

Personalization Applet
Personalization Applet - Rule Set
Personalization View
Personalization - Rule Sets
Runtime Events - Objects
Runtime Events - Action Sets
DVM
DVM - Rule Set

A simple SWOT analysis will give you a better detail.

Strength
- It searches for given Profile attribute across all configurable client side artifact where we can use GetProfileAttr or SetProfileAttr methods.
- It gives results in the Output sheet which can be very useful in any support or maintanence project.
- It is easy to configure.
- It is flexible enough allowing user to select or deselect objects to be searched.
Weakness
- When searching across all objects watch out for performance.
- As it is based on Siebel mobile web client automation server it needs dedicated or mobile web client running in background.
Opportunities
- With ever increasing configuration and customization, this can be very handy tool for maintanence of project.
- Most of the time development is done by some team and support by other. In such scenarios this tool can be very helpful.
Threats
- Unattractive UI
- It doesn't search in siebel repository for profile attribute in this release.


Regarding search on the tool side there are already couple of options available including siebel repository search and awesome Oli has developed terrific repository analyser. I am also in process of enhancing this to make it search on tools side artifacts. As usual as it is in crude phase any input, suggestion and comment to improve are most welcome.

Happy Hunting!!

Disclaimer: It can be taxing on system to search on all objects, please do a dry run by selecting one or two objects to search in order to ensure it is working fine on your machine.

Tuesday, August 7, 2012

Confirm in Standard Interactivity

"Confirm" function in javascript is as powerful as batmobile which work as check for users prior setting or clicking mission critical values. It allows developer to seek user blessings if they want to perform particular operation or not.In ongoing series on Standard Interactivity, here we will discuss usage of "Confirm" and use the result to set/reset values in SI mode.

Problem Statement: In eService Portal, whenever user is changing status values, he/she should be prompted with confirmation message and based on Yes/No values should be set.
Solution: As in HI client it is cake walk solution to implement where one can use BS "PreSetFieldValue" event of BC. However with SI client under question things become different with architectural limitation. The solution is orchestrated using the DOM events available in SI application. Following piece of browser script code is written on onfocus and onchange events. The key here is to determine the sequene of events. onfocus happens before onchange event for Status column.

general declaration:
var preValue;

function Edit_SList__0__Column__Status__onfocus (applet, id)
{
preValue = document.getElementById(id).value; // Fetch current value of status
}

function Edit_SList__0__Column__Status__onchange (applet, id)
{
if(confirm("Are you sure you want to change Status"))
{
document.getElementById("WriteRecord").click();
}
else
{
   document.getElementById(id).value = preValue;
   document.getElementById("WriteRecord").click();
}
 }
This will set/reset the values of status column based on user consensus. A curious mind by now must be thinking can we have Confirm on button click also. Yes we can. My support(ID 745518.1) already have solution to that.

Happy Crunching!!

Tuesday, July 31, 2012

Changing Font and Color

"Mere color, unspoiled by meaning, and unallied with definite form, can speak in thousand different ways." -- Oscar Wilde
Status bar is a common feature in siebel where color encoding depicts the status of record. I recently encountered similar scenario where i had to display different coloured text based on certain conditions on Form Applet. Browser script clicked me first. But finally this was achieved using configuration. As i struggle to achieve similar result in List applet we will discuss how on Form applet desired could be done. Lets take Service Request entity as an example (offlately this is becoming my favourite entity).

Problem Statement: If SR has some related SR then it should display some text in Red else alternate text in green.

Solution:

a) Go to SR buscomp. Create following fields

Name: PastSRRed
Calculated: True
Calculated Value: "< font color='red' > "+"This SR has related SR." +"< font > "

Name: PastSRGreen
Calculated: True
Calculated Value:  "< font color='green' > " +"No related SR found" +"< font > "

Name: PastSRDisplay
Calculated: True
Calculated Value: IIF(Count("SR") > 0,[PastSRRed],[PastSRGreen]) // In this SR is the name of multivalue link between SR and related SR bc.

b) Go to SR form applet, where text needs to be displayed. Create following control.

Name: PastSRDisplay
Field: PastSRDisplay
DisplayName: PastStatus
HTML Display Mode: DontEncodeData

Compile BC/applet and lookout for changes. But to fetch this on list applet is still mystery for me. Any thought on list applet will be of great help.

Happy Coloring !!