Showing posts with label Crunchers. Show all posts
Showing posts with label Crunchers. Show all posts

Saturday, November 15, 2014

BI Publisher and OBIEE Dashboards

The most complicated skill is to be simple.

There are multiple ways to invoke BIP reports in siebel. You can go for Symbolic URLs or Browser scripts or if reports are IO based, standard menu based invocation is the option. However one more interesting way is to invoke BIP reports from OBIEE dashboards. Usually OBIEE dashboards are configured in the system to display analytical reports. If you want to blend your BIP reports into the dashboards, it can be easily done in one click. The advantage here is you don't have to touch siebel environment for anything. Build your BIP report and pull it in the existing dashboard in OBIEE.


The only catch here is if your BIP report is parameter based and if you use BI Publisher section in your dashboard page, you will loose your parameters. Parameter section doesn't come in the BIP reports displayed in OBIEE dasboard. As an alternate you have to use "Embedded Content" section in your dashboard page and need to use link of the BIP report With "No Header" option. Specify height and width of the pane and you are ready to go.  As simple as it can be.

Happy Reporting!!

Thursday, December 12, 2013

Authentication Business Service

Most people want security in this world. So whatever piece you design, Authentication becomes the key aspect. There are times when you want to authenticate whether the user-in-context is valid siebel user or not without actually logging into the system. This type of requirement is typical in Mobile Solutions using HTML5 and siebel webservices.

Here I unearth one more hidden gem of siebel, "Authentication Business Service". This magical service authenticates user against siebel irrespective of your security authentication mechanism. Be it database or LDAP it will return you valid siebel user name else invalid user/password error.The method is "Authenticate".  It accepts three input parameters:

1 - User Name - User Name to be authenticated in siebel
2 - Password - Password of the user
3 - GetPrivateCredentials - Y OR N based on the requirement.  If set to Y it will result user name in "Siebel User Name" output parameter.

One can see its usage in "LS Medical User Verification" workflow to get better feel of it. You can create web service based on this BS and can rest assured of your authentication approach. Hope it helps.

Happy Authentication!!

Tuesday, September 3, 2013

Multiple File Attachments

Necessity is mother of taking chances. In recent outrage by our business users, we were asked to provide option of selecting multiple file attachments. Unfortunately siebel doesn't provide option of creating multiple attachment in one go. Even drag and drop in High interactivity creates only one attachment. With Open UI there are options but with good old HI and SI mode this can be real tricky. However, With mix of HTML-Javascript-browserscript we were able to achieve a custom built html file with multiple file browse options. where user could select three files in one go.



Below custom file browse HTML was used . Name is as "MultiFileAttach.htm".


Once the HTML page is ready, copy it in  Siebel\Client\PUBLIC\Enu and \siebsrvr\WEBMASTER\enu folders. I was not able to use Multiple attribute for file input type (food for thought for Javascript masters) so was forced to use three different file controls. The key here is returnValue property which returns the "," separated file paths, which we use in our browser script to parse and create attachments in siebel file system.Below is the browser side code.

 

We are invoking the custom "MultipleFileAttach.html" using ShowModalDialog method. Once we capture the path of attachments, "FINS Industry BC Facility Service" is used to create the attachments. In order to use this BS on browser side one must define this as part of user property on Application Level. One on Open UI can sleep well as there are lot of plugins available for Multiple File uploads. Java punters can propose alternate solutions to this approach, as usual your comments/inputs/suggestions are most welcome.

Happy Crunching!!

Warning: This piece is for demo purpose. Please test this solution thoroughly before you implement in your production systems.

Sunday, June 2, 2013

UIF Calendar Control in MVG Applet

Recently while working on multilingual application we faced strange issue. While setting values in MVG applet with calendar control, any date value was getting appended with UIF_ string. As a result invalid format error was coming. Eagle-eye pursuit resulted in the fact that even on the calendar control the month was like "UIF_May". To our surprise this issue was not happening on all machines. It was occurring only in some of the user machines with specific configuration. On discussion with Oracle it is found to be product defect.
                                                           


With configuration of Windows 7 and IE 8, it happens in ARA/ENU/FRA implementations. In order to resolve the issue IE 8 must be updated to latest patches from Microsoft or as an alternate solution could be:

1. In the Internet Explorer browser, go to Tools > Compatibility view setting > Uncheck all the options.
2. Press F12 and set the Browser Mode value to IE8.

This will resolve the issue for while.  

Happy Crunching!!

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!!





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!!

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 !!

Explicit Write in Standard Interactivity


Offlately i am working on SI application and being bombarded by lot of user acceptance issues. I am not sure whether God is really happy or its just a clearance sale that most of the time we are able to find the fix. Recently we were being asked to implement explicit write sort of scenario in standard interactivity portal. In the detail applet for service request user didn't want to click Save button to save the record instead it was required as soon as details in the Description are filled record should auto save.

Again browser script comes to party. As browser script on standard events of Applet/BC doesn't work under SI architecture, only control level events are supported. Ever friendly Alex has beautifully explained the browser script architecture in his recent post. So idea here is to explicitly call the click event for "Save" button on the applet for OnChange event of Description column. Fortunately for us most of the fields on the applet were auto populated and read only so this solution is not that performance taxing.

However the key to this solution remains the HTML attribute property of the "Save" button control. As siebel generates its own SWE html ids(like s_1_1_6_0) so it becomes very important we give custom id to this button in order call it in other events. This can be achieved by adding below attributes to the control in tools.

HTML Atttribute: id=WriteRecord 

Once the id is associated with button control, we can easily call below code from OnChange event:

function Edit__0__Control__Description__onchange (applet, id)
{
if(document.getElementById(id).value != "")
{
document.getElementById("WriteRecord").click();
}
}

This approach though has some inherent disadvantages as this can be only used when controls/columns in the Form/list applet are less. Any other approach/idea/comment to achieve explicit write functionality in SI application is always welcome.

Happy Crunching!!





Monday, April 9, 2012

Validation Utility Service


Many  times we have wished that workflows could have ActiveViewName function so that we can perform actions based on the current view. For long i have been resolving this by using profile attributes in workflow but GetProfileAttr('ActiveViewName') is not bullet proof, as when we do Reload/Refresh profile attribute it clears out this profile attribute.



In our quest to overcome profile attribute usage, we discovered another siebel gem, rarely talked,business service "Validation Utility Service". This business service contains a method "GetActiveView" which returns active view name. One can directly use this business service in workflow and can get name of active view.

While writing this piece i also came across another siebel blog which talks about fetching active view details using different business service. Hope either of business service helps your cause.

Happy Crunching!!



Wednesday, March 7, 2012

RTCEmbedded Control

"When the solution is simple, God is answering"- Albert Einstein

Recently we were asked to implement a embedded text editor in a control which could facilitate user for text formatting including features such as bold, italic,font, color etc.  The first reaction was can-we-do-it types with nothing popping in mind (Yeah, thought of Email Templates view never occurred ).But with some help of support web solution turned out to be much much simpler.

We can achieve this by using control of type "RTCEmbedded". This control type provides an embedded text editor which supports below html tag:
  • Bold < STRONG>
  • italic <EM>
  • Underline <U>
  • Ordered list <OL>
  • List items <LI>
  • <P>
  • <FONT>
  • <BLOCKQUOTE >


However there are certain caveats while using this type:
1 - Control doesn't turn out grey in case of read only conditions.
2 - Throws an error when reaching field length and clears out everything forcing user to renter everything.
3 - It is not currently possible to paste text and graphics (such as graph or image) within such controls.
4 - We can't use this column directly in SQL based reporting purpose without appropriate parsing.

Happy Crunching!!


Sunday, February 19, 2012

Disabling button in SI Mode


Working with SI applications can be as good as playing with fire. Recently we faced an issue when some naughty users clicked button multiple times resulting in underline action getting executed multiple times. As in case of SI applications, if the method is taking time to execute then button is not disabled it remains active giving end user an impression of nothing-is-happening. So user may end up clicking the button multiple times.

The only way to prevent multiple clicks is to disable button as soon as it is clicked. Fortunately there is an article on support which provides solution to achieve the desired but a scripted one. Following piece of code can be used to disable button after click.

function WebApplet_ShowControl (ControlName, Property, Mode, &HTML)
{
    if(ControlName == "SubmitButton")
    {
      if(Property == "FormattedHtml")
      {
          var index = HTML.indexOf("onclick=");
          var start = HTML.substring(0,index+9);
          var end = HTML.substring(index+9);
          var func = 'setTimeout("a()",10);; ';
          var funcA = "<script>function a(){";
          funcA += "var c = document.getElementById('SUBMIT');";
          funcA += "c.outerHTML='';";
          funcA += "} <script>";
          HTML=start + func + end + funcA;
      }
    }
}
However, we wanted to implement the solution by configuration and yes, we were able to achieve by using following piece of code in "HTML Attributes" property of button.

onclick="function fn(){disabled=true;}setTimeout(fn, 100);"

The idea is to diable button once it is clicked and making a recursive call after 100 milliseconds by using setTimeout function so that it gives user an impression that button is disabled. There could be alternates to achieve this. Again piece of advice/comment is always welcome. 

Happy Crunching!!

Thursday, February 2, 2012

Distinct Property


Distinct clause is one of the powerful clause in SQL which helps to remove duplicates from the result set. In real time scenarios we are bound to have requirements which involves updates or removal of distinct records.



Siebel provides a,how-i-missed-type, "Distinct" property on business components that helps us to achieve just this. Business components in siebel 7.8 and higher have this property. Setting this property to TRUE allows the equivalent of a select distinct query as it suppresses system fields.This property enforces a "DISTINCT" clause on all fields present in the BC, which may lead to errors during execution. It is better to clone business component and include only fields which are required in distinct clause.

Document ID 867149.1 in support web explains this siebel virtue in detail.

Happy Crunching!!


Monday, January 23, 2012

Multilingual Confirm/Alert in Browser Script


Working with multilingual can be as challenging as playing tennis with rafael nadal on clay court. Siebel provides outstanding set up to enable multilingual application.

There are different object managers for different langauges. There are symbolic strings for multiple language references, there are message categories to enhance re-usability. Lookup's for value comparison in different languages and not to forget multilingual email templates along with BIP reports giving end user 100 percent localized effect.

There are still some non-localizable elements including log files and help applets. However while working on the browser side i was not able to translate the message in the desired language using "LookupMessage" method as it is only supported on the server side. In order to achieve localization we used below java methods to identify the language in url display message accordingly.

Lets say you want to display confirm box in french application probably this piece may help you to achieve desired results.


var sURL = document.location.href;
var sCount = sURL.search(/fra/i); // this will search for object manager language
if(sCount > 0)
var sMsg = "Décochez va supprimer les données, Voulez-vous procéder";
else
var sMsg = "Uncheck will remove the data, Do you want to proceed?";
if(confirm(sMsg))
return ("ContinueOperation");
else
return ("CancelOperation");


There could be alternates to achieve this. As i write, another issue related to multilingual is dangling in Stop step in workflow. Question is whether we can use LookupMessage function in workflows or not? Any thoughts on this are much appreciated.

Happy Crunching!!





Wednesday, November 23, 2011

Query within date range


Date range is one of the very common requirements across project. It eases out lot of tasks for end user, one can easily generate report or export data items within given date range. Recently we were asked to implement similar functionality by inputting From and To date from the end user and resulting in all Service Requests between the given date range. There could be multiple solutions to go about it but one potential one is detailed below.

1 - Create Two calculated fields in SR BC.FromDate and ToDate of type "DTYPE_DATE". Set the calculated value to "Today()".
2 - Expose these two fields in the Query mode of the Applet. In the Edit Mode hide these controls.
3 - Below piece of code is required for setting up the Search expression and clearing the specs on To Date and From Date.

var sFromDate = this.GetSearchSpec("FromDate");
var sToDate = this.GetSearchSpec("ToDate");
if(sFromDate != "" && sToDate != "")
{
 var sFrSubDate=sFromDate.substring(3,5)+"/"+sFromDate.substring(0,2)+"/"+sFromDate.substring(6,10);
var sToSubDate = sToDate.substring(3,5)+ "/" +sToDate.substring(0,2)+"/"+sToDate.substring(6,10);
var sSearchSpec = "[Created] >= '"+ sFrSubDate+ "' AND [Created] <= '"+ sToSubDate +"'";
this.ClearToQuery();
this.SetSearchExpr(sSearchSpec);
}

This code is generic enough without any error handling. Please add conditions as per your requirement. The basic catch here is we need to clear the FromDate and ToDate specs and build a new expression involving range and any other existing search criteria. Any dates used with SetSearchSpec must use the format
MM/DD/YYYY, regardless of the regional control panel settings of the server or client computer so the date variables should be modified to give proper result.

Happy Crunching!!


Wednesday, October 12, 2011

Tools Crash - Edit Web Layout


They say software upgrade is nothing but a replacement of old bugs with new bugs. so better be prepared when you are going for machine upgrade, a working code may meet dead end. Recently one of my friend upgraded his machine to Windows 7 with IE 9. To our initial delight siebel was working fine but devil 
really lies in details. 
While trying to modify existing applet and view web templates siebel started crashing. Whenever "Edit Web Layout" was clicked siebel stopped working. After some search it was found that because of IE 9 that siebel was crashing. The crash was found to be due to mshtml.dll that is related to the version of the Internet Explorer. Morever it was found that Internet Explorer 9 is not listed as a supported IE version in System Requirements and Supported Platforms document for Siebel Version 8.1 (I know this should have been referred prior installation) but thought of tools crashing cause of IE version never crossed mind. After IE 9 uninstall, tools started working fine perfectly.

Anybody facing a tool crash on edit web layout, make sure you don't have IE 9 installed on your machine. 

Happy crunching!!

Wednesday, July 27, 2011

Different Query Mode in Edit List

I crunched one. This post is an addendum to one of my previous "Food for Thought" post where the main challenge was to display different columns in Query Mode when applet is displayed in Edit List Mode. with some configuration-Scripting-Luck i am able to achieve this scenario.

The key ingredient here is the usage of Dynamic Toggle. Following necessary steps are required to achieve desired solution.

1 - Create a clone of the list applet which should be displayed in Query Mode. Remove unnecessary Columns which are not required to be displayed while querying. Consider two applets are:
a) SR List Applet
b) SR Query List Applet

2 - Make the "SR Query List Applet" as the default applet to be displayed in the view.

3 - Create a calculated field in the Service Request BC with following values:
Name: QueryCalc
Value: IIF(GetProfileAttr('QueryMe') = 'Y','Y','N')

4 - Now create a dynamic toggle in the "SR Query List Applet". Set the "SR List Applet" as toggle applet with following Value in the condition.
Auto Toggle Field: QueryCalc
Auto Toggle Value: Y

5 - Once toggle is created, its time to set Profile Attribute. Following piece of code is required in below applets:
a) SR Query List Applet
Following script is written to toggle to SR List Applet.

function WebApplet_PreInvokeMethod (MethodName)
{
if(MethodName == "ExecuteQuery" || MethodName == "UndoQuery")
TheApplication().SetProfileAttr("QueryMe","Y"); //This is used to toggle back to Applet with More Fields
}

function WebApplet_Load ()
{
TheApplication().SetProfileAttr("QueryMe","Y"); //This is used to toggle back to Applet with More Fields
}

b) SR List Applet

In this applet we will create our own custom method and will invoke NewQuery.

function WebApplet_PreInvokeMethod (MethodName)
{
if(MethodName == "TestQuery") //Instead of Query We are calling our own custom method. Test Query
{
TheApplication().SetProfileAttr("QueryMe","N");
this.BusComp().SetSearchSpec("Id","");
this.BusComp().ExecuteQuery();
this.InvokeMethod("NewQuery");//New query is executed on the default applet in the view
return(CancelOperation);
}
}

The key here is to execute a blank query and then do New query so that the default applet in the View appears,i.e. the SR Query List Applet. Compile the objects and look out for super cool stuff. Siebel Rocks!!!

Disclaimer: There are caveats in this approach. This should be thoroulgy tested before you implement in your scenario.

Happy Crunching!!

Tuesday, July 19, 2011

Popup visibility - Division Based

It is very critical that one should have appropriate access to information available. Thus siebel has given comprehensive access control mechanism which helps in restricting data visibility. We can have visibility filter at multiple levels including View, Business Component, Picklists, Drilldowns, Links .

However the modes which we can set is restricted to following values:

All
Personal
Sales Rep
Manager
Organization
Sub Organization
Group
Catalog

Recently i was asked to have a visibility control based on the Division during the assignment of Service Request. One should see employees related to his division only when he opens employee pick applet.

We opted for Personalization to implement this as it gives a flexibility to change the filter dynamically without any srf change. Steps required are:

1 - Set the Popup Visibility Type to "All" for employee buscomp. (Please check before doing this as this will impact all Picklists based on Employee BC)

2 - Create a Personalization Rule set for "Employee Pick Applet" with below Include Expression:

"EXISTS ([Division] = GetProfileAttr('Division Name'))"

where "Division Name" is the division of Primary Position which is pulled in Personalization Profile BC using join. However this approach fails when user has got multiple positions and he changes the active position from "Change Position" View via User Preferences. In such scenarios we need to set/reset Profile attribute after Change Position is executed.

Happy Configuration!!

Wednesday, July 6, 2011

Cursor Modes for ExecuteQuery

Ignorance is bliss.A lot has been written about the cursor modes when using ExecuteQuery method. As a general rule by birth we are told, when using the ExecuteQuery method in scripting, the recommended cursor mode is ForwardOnly if there is no need to step backward through the result set.

But ForwardOnly cursor mode should not be used in a user interface context, for example, when the business component being queried is displayed within an applet of the current view.


I was victim of this ignorance. We had a requirement of querying on the EBC based on the query spec we get from other applet in the view. I have added ForwardOnly mode in the executequery method and to my horror query results were always returning only one record in the applet. Turning on the ForwardBackword cursor mode in the ExecuteQuery method fixed this isssue. The issue was When accessing database records with a cursor mode of ForwardOnly, only one record at a time is retrieved and kept within the Siebel Object Manager memory as a result only one record was being displayed as query result. When using ForwardBackward cursor mode, all of the qualifying records were retrieved.

Happy Crunching!!

Thursday, June 2, 2011

S_SRM_TASK_HIST Table

One of my admin friend once told me that the problem with troubleshooting is that trouble shoots back. In my on going quest for controlling multiple Login-Logout sessions in Directory authentication environment i landed up in situation where we required to know the list of naughty users who are working in multiple sessions. Instead of shooting back to admin friend i thought lets-hit-google and really found something worth sharing.

Issue: We set Flag on Login and unset the same on Logout in order to determine availability for assignment purpose. In multiple login/logout scenario this approach fails. We have to maintain the exact status of Employee in order for correct assignments.

Solution: This could be accomplished in two ways. First option is, We can have batch script which executes command to list the number of sessions currently logged in each application server.

List Active sessions for comp PsCcObjMgr_enu show SV_NAME,CC_ALIAS,OM_LOGIN

Above command will list the active sessions. Based on the active sessions we can update flag (Available/Unavailable) in db for logins by using stored procedure.

But being KISS(Keep it short and simple) follower an alternate and effective solution could be to query DB for active sessions and update the flag as required. Now the question arises is how to fetch active sessions from db itself. "S_SRM_TASK_HIST" table comes as life saver in this scenario. This table lists all the sessions on the object manager along with start and end date. So we can easily determine which is active and which one is dead.

select SRVR_START_TS,SRVR_END_TS,SRVR_COMP_NAME,SRVR_USER_NAME
from siebel.S_SRM_TASK_HIST where SRVR_COMP_NAME IN ('PSCcObjMgr_enu')
Order by SRVR_USER_NAME

S_SRM_TASK_HIST stores the task information for all the object managers. By default it is set to maintain history for 24 hours but it is configurable.

There are not many ways to control multiple login in siebel but each fails with some shortcomings. More ideas to control multiple logins are welcome here.

Happy Crunching!!