June 17, 2016

Scriptless Challenge : How to constrain association list applet dynamically?

Association applet let's you associate records from an existing list of records. Unlike pick applets these association list applets doesn't have any out of the box way of constraining records.

Consider scenario: When opportunity type is internal, system should only show internal marketed products for opportunity in product association list applet and for opportunity type external system should show only external marketed products. Products are marked as internal and external by product type field.

Challenge: According to oracle there is no other way then scripting on web load of association applet to filter the records. Script can look something like following. And it works flawlessly.

Can you suggest any script less alternative?

function WebApplet_Load ()
{
var BO;
var ParentBC;
var BC;
var AccountId;
BO = TheApplication().ActiveBusObject();
ParentBC = BO.GetBusComp("Opportunity");
if(ParentBC.Name = "Opportunity")
{
    AccountId = ParentBC.GetFieldValue ("Account Id");
    BC = this.BusComp();
    with (BC)
    {
        ClearToQuery();
        ActivateField("Account Id");
        SetSearchSpec ("Account Id", AccountId);
        ExecuteQuery();
    }
}
ParentBC = null;
BC = null;
BO = null;
}


June 16, 2016

How to hide disabled buttons in Siebel Open UI?

With IP 15 and 16 Open UI themes have inclined towards bigger controls and more blank space on page, which is not bad thing but too much of it is making UI cluttered specially on small screens.

To fix this issue one can hide all disabled controls and all the white space around it. this can be done by simply adding following CSS and Open UI framework takes care of the rest.

button.appletButtonDis {
    display: none;
}

Further on to hide disabled menu items add :

li[aria-disabled=true]{
    display: none;
}

Siebel adds these classes and attributes to all the buttons on all applets and menus including new/query/delete icons to show them as disabled. Thus this change effects the entire application.

This post is contributed by esteem reader from down under via siebel-developers slack community. Register today to read more discussion like this.

June 06, 2016

Siebel Admin [Cheat Sheet]

I see many Siebel consultants(including me) searching web everytime to get correct syntax for Siebel server manager commands.

Although the syntax is so simple we still somehow manage to forget it :) I have created this cheat sheet from list of commands which I use day in day out. List contains command to increase log levels, shutdown startup components, creating components, starting server manager.

Feel free to download and print one for your desk.Download Here

Hopefully no more searching for commands to increase log level of siebel components :) cheers!

June 03, 2016

Siebel Integration Interview Questions - JMS Transport

This article only covers Siebel integration interview questions related to EAI JMS Transport , see Siebel EAI Interview Questions for other Integration interview questions.

Question 1: When should JMS be used over web services in Siebel integration requirement?

Answer: JMS queues are based on store and forward guaranteed delivery mechanism. That means source system sends the message to middleware which holds the message in queue until Siebel server reads it thus message is never lost.

However on other side web services doesn't have retry mechanism in architecture. In case of heavy load or server unavailability message can be lost if source system can't resend it. Benefit of using web services is that they are faster to develop, setup and maintain.

Question 2: How does JMS integration works in Siebel?

Answer : Siebel has JMS receiver server component which can pull XML messages from JMS queue for data transfer. For JMS components to get messages from JMS server Siebel needs to have JAVA installed on Siebel server.

Question 3 : What is the difference between queue and a topic of JMS?

Answer: Queue is is implementation of first in first out data structure, and can be used only between one source and one consumer. Once XML message is consumed by consumer it is deleted from the queue.


Topics also have queue like store and forward mechanism but with the difference that they do not delete XML messages immediately after it has been read, the same message can be read by another consumer (application). Thus well suited for 1 to many integration scenario.

Questions 4 : What steps are involved in JMS component setup in Siebel?

Answer:  Siebel JMS setup involves minimum three items :
- Setup of JVM (Java) subsystem
This tells where is Java files and server details of JMS server.
- Setup of JMS subsystem
This contains queue or topic information
- Setup of receiver component
This component pulls XML messages from JMS server mentioned in JVM sub system from queue mentioned in JMS subsystem.

Question 5: What is jndi.properties file? What it is necessary?

Answer: Java subsystem required for JMS integration required JMS server location information such IP address and port. This information is kept in jndi.properties file in Siebel filesystem.
It looks something like this: https://docs.oracle.com/javase/jndi/tutorial/beyond/env/src/jndi.properties

Questions 6: what kind of logging is available for JMS transport?

Answer:  EAI JMS Transport  provides two logging methods, first one is the traditional Siebel logs which can be turned on by increasing log level of receiver component.

Second type of logs are Java logs which generated by Java virtual machine installed on Siebel server , they can get turned on by setting VMOptions in Java subsystem.

See more Siebel EAI Interview Question

[Download] EAI JSON Converter v2

Pleased to bring you the complete EAI JSON Converter v2. It happened a lot sooner than I expected.
Siebel EAI JSON Converter

Below is the code which converts JSON string to property set. The heart of the code is eval statement, which converts the JSON string into eScript Object. 
Siebel eval statement

Remaining code is just the recursive traversing to convert object into property set. I have tested the code for couple JSON strings, it passed everytime with flying colours every time. Feel free to change the code as required. 

You can download the complete sif from git hub. https://github.com/Jimjson/eScript-based-EAI-JSON-Converter-


EAI JSON Converter Demo: 

How to force shutdown siebel server < 2ms

This is in continuation to my earlier post on How to shutdown Siebel server in less than 5 secs

And is suggested by a reader of this blog, who seems to be even more impatient than me(in a good way), and had automated the step to query Siebel server and step to use task kill command to bring down Siebel server as mentioned on my earlier post.

Final batch file looks something like : 

FOR /F "tokens=3" %%A IN ('sc queryex siebel_service_name  ^| findstr "PID"') DO (SET pid=%%A)
IF "!pid!" NEQ "0" (
taskkill /pid %pid% /f 
)


taskkill /im siebmtshmw.exe /f
taskkill /im siebmtsh.exe /f
taskkill /im siebsess.exe /f
taskkill /im siebprocmw.exe /f
taskkill /im siebproc.exe /f
Once executed with admin privileges, it brings down Siebel server at very instant. I have tested this, and it works beautifully.
Memory Release

Why this is faster than usual way? 
Usual way of bringing down service does memory cleanup and waits for long running processes to complete, gives some time to gracefully complete the tasks I think it copies the log files around as well.

However this batch file just pulls the trigger and knock down the server in one shot. There is a risk of data corruption, use it at your own risk!


If you have done something like this with Siebel which is not recommended but saves you time then please share it with us in comments section below.

June 01, 2016

Siebel EAI Interview questions - Web services

View latest 2020 Interview questions here:
Siebel REST API Interview Questions
Siebel EAI Interview Questions - JMS Transport

Question 1: What is the difference between outbound and inbound web services?

Answer: Inbound web services are hosted/served by Siebel and is invoked by external application to send data or to query data from Siebel.
Siebel Inbound Web Service

Outbound web services are web services which are hosted by external applications like SAP or Middle-ware and is invoked by Siebel workflows/business services to send or query data from external system.
Siebel Outbound Webservice


Question 2: What is WSDL?

Answer: WSDL stands for Web Service Definition Language. It's a standard for describing web service end point, it contains information about what all methods external system can call and what are input and output arguments for the service.
For Inbound web services Siebel dev team needs to provide WSDL, which is created from Adminstration Integration> Inbound Webservices view.
For outbound web-services external system like a billing system provides WSDL which is imported into Siebel.
Generate WSDL in Siebel

Question 3 : How WSDL is imported into Siebel?

Answer : Siebel inputs WSDL in two steps. Firstly WSDL is imported into Siebel tools which creates proxy business service and IOs for arguments.
WSDL Import in Siebel Tools

Second step involves creating web service end point in Administration integration> outbound web service which is done by imported by xml generated in first step.

Question 4 : What is filter business service in Siebel?

Answer: Filter business service is a custom business service which can be configured to be invoked at web service invocation just before or after actual workflow call. This service is used to handle custom soap headers of web service .

Question 5: What is SOAP Message? Which version of SOAP is supported by Siebel ?

Answer : SOAP Stands for Simple Object Access Protocol it is a XML format which exchanged by web services, SOAP 1.1 is supported by Siebel.

Question 6: When would you recommend using web services over queue based integration?

Answer: Web services should be used when business process can not wait for response from external system. For example : Order can not proceed without checking the inventory and user cannot wait before submitting order.

Question 7: What is the difference between EAI HTTP Transport and web services?

Answer : Web services is a HTTP based standard which uses WSDL to describe structure of input and output arguments and methods which can be invoked on server.
HTTP Transport can also be use to transfer data in and out if Siebel server however there is no description of input and output data structure and types.

Question 8: Can workflow be published as inbound web services?

Answer: Yes workflow and business service both can be published as web service in  Siebel.

Question 9: What is proxy business service in Siebel? and How does proxy BS works internally in Siebel?

Answer : Proxy business services are business services in Siebel which are created for each WSDL import in Siebel tools. Proxy business service converts in the input arguments into SOAP message and invokes HTTP transport to send data to external system.


EAI JSON Converter - v2 (No Java)

I published EAI JSON Converter business service based on Siebel Java business service back in 2013, and many people seemed to like it and implemented it. See the old post here. It was great to see that code getting implemented in production by many people. Surprisingly equal number of people faced difficulty in implementing the Java business service which is required to get EAI JSON Converter working.

Thus I started working towards removing dependency on JAVA business service and created complete eScript based solution as ver2 of EAI JSON Converter business service.
Generate JSON in Siebel without Java


This service will have the same methods and arguments, and will outputs similar JSON string and property set as previous version did but without the need of JDK. It is complete plug and play service, just copy paste the code and start using the service.

function CreateJSON(Inputs){
/*********
Created By: Jim
Support: http://howtosiebel.blogspot.com
*********/
    var str,j;
    var propName = "";
    var propVal = "";
   
    str = "{";
   
    propName = Inputs.GetFirstProperty();   
   
    //Type and value
    if(Inputs.GetValue() != null && Inputs.GetValue() != ""){
        str = str + '"' + Inputs.GetType()  + '"' + ":"  + '"' + Inputs.GetValue() + '"';   
        if(propName != "") str= str + ",";
    }
   
   
    //Properties
    while (propName != "") {
        propVal = Inputs.GetProperty(propName);
        str = str + '"' + propName +  '"' + ":" + '"' +propVal + '"';
        propName = Inputs.GetNextProperty();
        if(propName != "") str = str + ",";
       
    }
    propName = Inputs.GetFirstProperty();
    if(propName != "" && Inputs.GetChildCount()> 0)str = str + ",";
   
    //Loop for child
    if(Inputs.GetChildCount()> 0){
    if(Inputs.GetChildCount()> 1)str = str + '"Object"' + ":" + "{";
    for (var i = 0; i < Inputs.GetChildCount(); i++){
            j = Inputs.GetChild(i);
            str = str + '"' + j.GetType() + i + '"' + ":" + CreateJSON(j);// + ",";
            if(i+1<Inputs.GetChildCount()) str =str + ",";
    }
    if(Inputs.GetChildCount()> 1)str = str + "}";
    }
    str = str + "}";
    return str;   
}
Hope the code is self explanatory. Feel free to edit it for your implementation. I have tested the output and validated for RFC4627.

Creating JSON string from property set was easy I traversed through the property set using out of the box Siebel methods and created the string. Creating propset from JSON proved difficult, I am still working on solution for interpreting JSON and converting it into property set, I have made some progress will post it as soon as it is working satisfactorily.

If you want to contribute in nobel cause then contact me via comments below and don't forget to plus one this post on Google. All comments are welcome.

May 25, 2016

Guide to resolve Generic SSA NOTOK error message. SBL-DAT-00472

SBL-DAT-00472: Generic SSA NOTOK error message.

SSA NOTOK Error in Siebel

This error occurs in Siebel when there is some fundamental configuration mistake, like syntax errors or missing workflows or incorrect joins are configured. This error can be very difficult to fix, as it leaves very thin trace behind and there is no indication to start with. When I faced this error I narrowed it down by going through the most common reasons of this error and started to rule them out one by one.

Following is the list which I followed from various support web articles.


1. Deleted Workflows

Runtime events that are created automatically by workflow deployment have row id of workflow specified on them, and if that workflow does not exist in system then run time event can throw this error. To debug this turn on the personalisation logs and narrow down which runtime event is causing the trouble.

2. Explicit Joins on 1:1 tables

Someone has created explicit join based on 1:1 extention table and name of the join is same as the table name. For example table S_SRV_REQ1_FNX is extension table of S_SRV_REQ, so one should not create join in Service request BC with table S_SRV_REQ1_FNX to avoid getting this error.

3. Calculated Fields

This is the most common cause of this error. Any syntax mistake in calculation or calculation which compares a two different data types can result into SSA NOTOK Error.
For example following calculation will cause this error :
IIf ([Status] = 1, 10, 0)
This because the status field is DTYPE_TEXT and it is compared to integer value.

In my case I had a field in BC with syntactically incorrect calculation. Which was easy to find as it popped up as first thing in BC validation.


4. BC field Validations

This is another place where calculated fields can be referred and could cause this error. This might not error out every time as calculation might not be evaluated in all conditions. So do check field level validations as well when trying to fix this issue.

5. Run-time events or DVMs

Another place I would look for would be RTE and DVMs as they also use Siebel query language to identify records and validate things and any syntax goof up can cause this error to popup.

Another place you might get this error is while generating sample XML for BIP reports, this happens because application is not able to find the folder location specified in component parameter for XMLPReportDataDir .



Please feel free to share and discuss your experiences with this error in comments below.

April 29, 2016

7 Siebel Tools hacks every developer should know!

These are my favorite Siebel Tools tricks that I use day in day out. I thought of sharing this before good old Siebel tools is made completely obsolete by new "Siebel Composer". Would be good to compare this with composer features in future when it is fully developed and available.

Repository search

This is Siebel tools inbuilt search feature. It can be used to find all objects with specific keyword in entire repository. I use it to find the use of profile attributes in scripts or in calculated fields, search spec etc... Pretty neat.
To start search go to Tools> Search Repository
Enter keyword and click Search Now


It's not super fast but it's best way to be sure.

Alternative of genbscript.exe

I still meet few developers who run genbscript every time after compiling srf. There is much easier way to generate browser scripts available.

Scripting options

As shown above, one can configure tools to update browser scripts automatically after every compile.

Add multiple objects to one sif file. 

There is no need to create separate sif file for each object. After adding one object just leave the archive window aside and go to object explorer to pick another object and add to save archive.


Siebel sif files.

Create list of values from tools

Yes, One can create list of values from Siebel Tools. For this menu to appear your login needs to have Siebel administrator responsibility. I love this interface, it is so much better than Siebel client.


Compare objects 

Siebel Tools provide unique way of comparing objects, its not limited to comparing objects with a sif file. Once can compare two similar objects like two business components or applets in same repository or a different repository.

Compare objects in Siebel Tools

Copy items from one object to other

This is one of the neat hidden feature of Siebel tools. While comparing two objects one can use this feature to copy some objects from one object to other.

Button to copy items from one object to other
 As shown on press of button one can copy fields from one BC to other.

Bookmarks!

This is one of my favorite hack. I bookmark all the objects of projects that I am working on, it makes really easy to navigate back an forth without typing.

To bookmark any object list just open the bookmark pane and click the plus sign. And double click on the list to find the objects again, no typing required!

Siebel Tools Bookmark icons
Siebel Tools Bookmarks in Action
Shown above is my current bookmark list. I have bookmarked Order BCs(thin and thick :)), Quote BCs, and custom business services.

Some bonus keyboard shortcuts :


F7 to compile all objects
Cntrl + F7 compile single object
Alt + H + R about record
F5 starting Siebel dedicated client
Shift + F5 restarting Siebel dedicated client



March 27, 2016

Scenario based Interview Questions - Part 3

This is the third post in series of Scenario based Interview Questions . I would highly recommend you to read the first two parts of this series.

 Scenario based interview questions Config - Part 1
Scenario based interview questions Workflows - Part 2

If you like the questions and would like to see more like this, then please +1 this post on google.




Interview with Yvette Francino

Recently I came across a very talented IT Manager Yvette Francino, unlike any another project manager blogging is one of her passions. She has worked as manager for Siebel Projects and have been working in Agile from a quite a long time, she has spent time in coaching teams for Agile. I took opportunity for asking hers some questions regarding Agile and she kindly shared some very useful resources which can help new team members to get started with Agile.

Here is the interview.

Question : Please shed some light on your experience with Siebel. Were you a Siebel developer?

Yvette: I was a development manager at Sun Microsystems from 1999-2009. For a short time around 2000, I managed a team that was using Siebel. I took the training, but didn't have much more hands-on experience than that.

Question : As almost every Siebel project suffers from scope creeps and effort overruns due to un-planned tech issues. Do you feel Agile is not suited for Siebel Projects?

Yvette: Projects that typically suffer from scope creep are the ones that are best suited for Agile methodologies. The more you don't know up front (which is true of most software projects), the better suited an empirical model, such as Agile, is because it allows you to let your requirements evolve and become refined over time as you learn more.


Question: What are the most important things without which you will never run an Agile project?

Yvette: Agile training for everyone, including management, is important, so that everyone has a common understanding of the processes they are using. Retrospectives, in which the teams regularly assess what worked well, what could be better, and what they want to do differently in the next iteration are also important so the team continually improves.


Question: How to plan for project with relatively un-known area of development? Do you recommend any special technique?

Yvette: Again, the more unknowns there are, the better it is to use an Agile methodology so that learning more is part of the process. There are techniques called "spikes" that allow development teams to do "time-boxed stories" to allow them to learn more about the unknown area.  They could do a small proof of concept or prototype, for example, to discover more and reduce the level of uncertainty.

Question : After so much experience do you feel Agile is actually more expensive than SDLC methodologies?

Yvette:  It depends on a lot of things. It can be expensive to change all your tooling and processes, so if the organization is heavily invested in traditional methodologies, it can be quite expensive to change. On the other hand, studies show that Agile projects are more successful than traditional Waterfall projects, and, obviously, unsuccessful projects are very costly.

Question: Please share a conflicting situation you had on project and how did you gone about resolving it.

Well, in the Agile world, one common conflict might be disagreement about how long it might take to code something (or how many "story points" a user story is). One way to resolve this is to maybe have a "spike" story (as described above), or to make the story smaller so there are less unknowns.  (A "story" is a small unit of working code or what might thought of is a "requirement" that results in working code.)


Do you have any or recommend cheat sheet/mantra for Agile projects for newbies?

Yvette: There are so many Websites and classes available that it's hard to recommend one. Scrum is the most common methodology by far, and the Scrum Guide is available for free. I also think Mike Cohn is a great teacher and there are online courses available from his site, Front Row Agile. You might also check The Agile Alliance for resources. It would be good, though, if teams were learning from the same courses or resources, though, since there can be quite a bit of variation in opinions, terminology, and Agile methodologies.

I would recommend all Agile newbies to download the scrum guide and refer Agile Alliance to get your head around the buzz words of Agile.
Thanks Yvette for your time!!

March 24, 2016

How to shutdown Siebel server in < 5 seconds?

Getting late for lunch date with girlfriend and damn Siebel server won't stop. Ever been in such situation??

Well I have been. This is my actual story, don't worry I am not going tell stories about my partner, it's about our favorite Siebel server which sometimes won't come down for good 10 or more minutes, don't expect anything for starting up.

Before I tell you the trick how I made it to my date on time, let me warn you about the repercussions. It's highly dangerous way of shutting down the siebel server, don't try this in important environments, use it only if you have no regards for your employer. And be aware that this could corrupt your installation or cause data corruption.  But hey! do partners care? if you kept them waiting, you will have to face the music for entire year or more.

For the siebel people in love, this is what you have to do to get to your date on time:
  1. Open command prompt on Siebel server host(I have tried this windows host only).Get the process id (PID) of Siebel server by running this query:

    sc queryex siebelservicename
  2. And then run following queries in exact sequence by replacing PID found in output of above statement :
    taskkill /f /pid 10116
    taskkill /im siebmtshmw.exe /f
    taskkill /im siebmtsh.exe /f
    taskkill /im siebsess.exe /f
    taskkill /im siebprocmw.exe /f
    taskkill /im siebproc.exe /f
Voila ! Siebel server is down . If you are successful you will see memory getting free faster than ever, srf will  be available for update and you can start the Siebel server the way you like.
Siebel Server memory consumption
And will see output like:

Shutdown Siebel server by command line

If you like this post and would like to see more like this, then please plus one this blog.

March 22, 2016

How to use Siebel Product Configurator API in Workflow?

What is Product Configurator API? 
Siebel product configurator API is bunch of Siebel business services and methods which allows to add order item under a root customizable product which complies with rules and validations defined in product model.

It is much more cryptic and complex if one starts with the bookshelf.

@renjith shared this beautiful document on slack community.This example explains how we can invoke Siebel Configurator API in correct sequence to add line items in an order.
Product Configurator API in Workflow
In this example, workflow first creates new order and a order line item for root customizable product using Siebel Operation Step. And then it invokes Remote Complex Object Instance service(API) methods to add line item under the root customisable product.

Product Model used for demo :
Siebel Product Model
 Business Service executed in sequence are:

  1. ISS Copy Service :: Load EAI
  2. Remote Complex Object Instance :: LoadInstance
  3. Remote Complex Object Instance :: CreateSession
  4. Remote Complex Object Instance :: SyncInstance
  5. Remote Complex Object Instance :: UnloadInstance

Level of simplicity and details shown in the document is just awesome. Hats off to @renjith!!

Download the document from here. If document has been helpful, then please plus one this post to let @renjith know.

If you have similar articles and would like to share with all viewers then please let me now in comments below. I will be more than happy to share.

March 14, 2016

Scenario based Interview Questions - Part 2

This is the second post in series of Scenario based Interview Questions . I recommend you to read first post of this series where we discussed Siebel Configuration Interview Questions before going through this post.

If you like the questions and would like to see more like this, then please +1 this post on google.

March 10, 2016

Scenario based Interview Questions - Part 1

Long ago an avid reader of the blog requested me to post some scenario based interview questions, and sent some good samples as well. I asked the same on siebel-developers slack community and got some really good answers. This is a three post series so stay tuned for next two posts.


If you like the questions and would like to see more like this, then please +1 this post on google, and don't forget to share your answer in comments below.

March 06, 2016

Is siebelhub.com down?

Is siebelhub.com down ? Probably not. I am sure team is working hard to keep it up , by the time you will read it, site will be back up.

Today for siebelhub.com CDN and host keep erroring out every now and then :( You might see following error if that happens.

Server Error:
Siebel-Hub is down?
or Cloud flare :


I know the feeling, when you are in middle of doing something and best siebel resource "Siebelhub" goes down, bummer!

Today I am going to share tricks that I use to view offline sites. It's not specific to siebelhub.com and can be very useful.

Solution 1: Use wayback machine. 
This will be simplest  and the best solution to view any website in past point in time. Way Back Machine has cached copies of nearly all websites in world and copies are available to search quite easily. I found a good cached copy of siebelhub.com on : http://web.archive.org/web/20150130060038/http://www.siebelhub.com/main/blog

Solution 2 : Use chrome's offline mode
Use this solution if you are offline. Like other browsers offline feature is also available from chrome, however it is hidden in chrome://flags . Good part of this is that you can view cached websites from your mobile device as well.


Step 1
Step 2
Step 3
To enable cache views open chrome://flags on any device and enable show saved copy button. After this whenever you are offline you will be presented with an option to view the cached copy from your device. However it is not guaranteed that all the webpages you opened will be available in device cache.

BTW, Do you know chrome has on offline game and it starts when you click on the dinosaur?

Solution 3: Use https://www.httrack.com - Desperate Measure
Don't try this at home. This is an open source tool which copies the whole website to your local pc. and the data is cached on your device for as long as you want.

Hope it helps.

PS: Posted just for the love of information present on siebelhub.com. hats off to guys who built it.

February 28, 2016

SBL-DAT-00501 : Invalid search specification ' < ? > '.


We detected an Error which may have occurred for one or more of the following reasons:
Invalid search specification '<?>'. Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00501)



invalid search specification <?>
SBL-DAT-00501
This error can come out of the blue moon and can cause some serious time waste and frustration. I learned to resolve it the hard way. In my case it was only occurring in the dedicated client and same srf was working on server perfectly fine.

This is error doesn't mean there is problem in search spec in eScript or MVLs or BCs. It usually occurs when calculated fields is having issues.

Possible reasons for this error:

  1. Any type of syntactical mistake in calculated fields
  2. Presence of carriage return in any calculated fields
  3. Calculated fields declared as DTYPE_TEXT however they are compared in another calculated field as integer.

How to resolve it?

  1. Turn on the siebel logs to level 4 and try the scenario again. And search for the error code in log file. 
  2. Just above the error code you should see the calculated expression which is causing issue. 
  3. Now go to flat tab and search with this calculation to find calculated field. Once culprit is found, BC recompile after change does the job.

Hope it helps.

Dynamically change start-up view for group of users

Requirement: To have a different start-up view for certain group of users in application.

Siebel sets start-up view of all the users using Application property which is a static view and the only way default view can be changed is by end user by updating user preferences. 

Solution: To make the view dynamic and override the user preferences following script can be added to Application_Start event of Application to redirect all the users to a specific view based on their responsibility.  These views can be used to show statuary information or terms and conditions.

Script queries Employee BC for logged in user and search for specific responsibility and executes a go to view if specific responsibility is found. Similar script can be used to change other part of the application. Feel free to share in comments below if you have come across similar behavior in your implementation.

var EmployeeBO = TheApplication().GetBusObject("Employee");
var EmployeeBC = EmployeeBO.GetBusComp("Employee");
var userResp;
with (EmployeeBC)
{
ActivateField("Login Name");
ActivateField("Responsibility");
var UserName = TheApplication().LoginName();
SetSearchSpec("Login Name", TheApplication().LoginName());
ExecuteQuery(ForwardOnly);
if(FirstRecord()){
userResp = GetFieldValue("Responsibility");
}
return (CancelOperation);
}
if( userResp == ""){
{
TheApplication().GotoView("");
}else{
return (ContinueOperation);
}


Hope it helps

February 18, 2016

Siebel Open UI Interview Questions plus bonus jQuery tips

Question 1 : What are different layers of JavaScript classes in Open UI ?

Answer: Siebel Open UI framework provider 4 different type of js files , proxy, presentation model(PM), physical renderer(PM), and plugin wrapper(PW). Out of these only PM, PR and PW are recommended to modify and extend. Proxy is an interface between Siebel server and browser, thus should never be changed.

Siebel Open UI Architecture

Read more

February 06, 2016

JavaScript Execution Sequence of Siebel Open UI


Hope everyone remembers Siebel event model explained by +Alexander Hansal 
No doubt that is one the best post in Siebel blogosphere till date, in case you haven't read it, I would recommend you to go through it here. This model still holds true and has helped many businesses to model processes. However with introduction of Siebel Open UI there are few more events available for customization on browser side. 


In this post I will show you how Open UI invoke different events and methods on custom PM and PR JavaScript files.

For this proof of concept I have created and associated PM PR files with some logging for all the applets and views. I have also wrote some browser script in applet load event in tools. Following summarizes what I found.

Sequence of JavaScript Execution in Open UI

What I found out that view PM layer is the first in sequence of execution, it is executed even before preload event. Thus all the data is available in preload to build the UI. Preload.js is not the event if someone is looking to execute at very start of view building.

Sequence of execution breakdown
Breakdown of events shows that List applet are executed first by Siebel Open UI (even if they are child objects). I suspect it is done to improve performance.

Additionally Applet load event are executed at last. Thus technically it is possible to override events available in "pre" Open UI era browser scripts in Open UI.

Points to be noted here that:

  1. Prelaod.js is not the first thing which gets executed during a view load.
  2. Open UI executed PM layer for view first and then applets, however for PR layer, applets were loaded first then view.
  3. Open UI also seems to execute list applet code first than form applet irrespective of hierarchy in tools!!
  4. After all the processing of PM PR layers(including view), Siebel at last executes applet load event of tools browser script.
Console Outputs:






Hope this will help developers to know the correct event they need to code and execution sequence in which Siebel will execute the code.


For this experiment I have created following PM / PR files .
  • OpportunityFormAppletPM
  • OpportunityFormAppletPR
  • OpporunityContactListAppletPM
  • OpportunityContactListAppletPR
  • OpportunityDetailContactViewPM
  • OpporuntiyDetailContactViewPR
  • OpportunityListViewPM
  • OpportunityListViewPR
  • OpportunityListAppletPM
  • OpportunityListAppletPR

All files I have used is available will be available for download soon.

Thanks to Duncan Ford for helping us in getting us code ready by creating the beautiful template generator.

Happy to discuss in detail on slack community or in comments below.

February 04, 2016

Chrome's hidden menu for Open UI

If you are working on css or js changes for Siebel Open UI, you would be struggling with browser caching. I have noticed some cache even when I am using incognito mode of chrome.

Out of frustration one might end up installing chrome app/plugin to forcefully clear cache. One of them is "Clear Cache" 

Interestingly chrome has now created a very discreet "Empty Cache and Hard Reload" option for developers. To see this option open developer tools by pressing F12 and then press and hold reload button. I have been using this option from past one week and it worked every time as expected.

Chrome Hard Reload for Open UI


Please be mindful that this is an hidden menu and only shows up when chrome's developer tools are open.


Happy coding :)

January 23, 2016

My top 5 Siebel Mistakes in 2015

I received a very candid email from a reader, asking me what mistakes I make in Siebel development and how do I overcome those?

Surprisingly I had a long list of mistakes, and I wasn't doing anything about it. So I decided to write this post to attempt on reducing these mistakes.




I believe in learning from mistakes, thus I challenge all my readers to list down their mistakes and leave them in comments below. Remember no one is perfect, so don't be shy and leave comment.

1. Using InvokeServiceMethod in calculated fields.


This is biggest performance degrader.I regret this one the most, I used this trick to calculate an status of opportunity and it turned out to be biggest technical debt of all time. No one want to fix it now and it is stuck there churning away time, memory and CPU every time it is referred.

2. Not checking CountRecords() Or FirstRecord() before get field value.

This is one of my most frequent mistake in Siebel. It goes unnoticed because the logic works for mostly all scenarios but one, what if there are no records retrieved from query? Siebel is going to throw it back to you, logic won't proceed and service will halt making you accountable.

So please don't be a Jim and always check for record count or First Record before proceeding.


3. No comments

Leaving no comments on blog post is ok, but leaving no comments in script is a big no no. Have your ever noticed how much easy it becomes if there is one of two line of comments in script? just one or two line makes it so convenient for developer to understand the code without going into details.

My self plead guilty of committing this some time.

If I have to create a standard I will try to use following template for comments:

/*
[jim] [25 Dec 2015] [ added code for xxxxx reason, code is invoked from xxxxx places]
*/

simple isn't it? Please share in comments below what type of comments you use.

3. Not nullifying objects after use.

Developers believe that ST script engine will clear up memory for them. But no memory leaks are real still in Siebel 8. So please Jim don't make that mistake again.

4. Try catch finally block
This is the only way for keeping some dignity, and we still avoid it to save time.  Do you also make that mistake?

5.  Using profile attributes.


They work like magic in some scenarios, but it is so difficult to trace them back, and using it in Open UI is like calling Mayhem. Please share your thoughts on this. How do you trace back the creation of profile attributes?

Please don't forget to leave your list of mistakes in comment below.

January 16, 2016

How to get name of siebel server in eScript?

I found this script recently on support web which allows us to get value of Siebel server name, log directory of the current session. I quickly extended script to get value of siebel task id and process id to help me in my debugging.

These values can be very useful if you are working on multi server issue. With the help of task Id I was able to find the log of current session without opening each log file. Please share in comments below on how you choose to use this script.

var serverSession_BO = TheApplication().GetBusObject("Server Admin - Sessions");
var serverSession_BC = serverSession_BO.GetBusComp("SA-VBC Session");
var taskParam_BC = serverSession_BO.GetBusComp("Server Task Parameter");

serverSession_BC.ClearToQuery();
serverSession_BC.SetSearchSpec("OM_LOGIN", logInName);
serverSession_BC.ExecuteQuery(1);
serverSession_BC.FirstRecord();

taskParam_BC.ClearToQuery();
taskParam_BC.SetSearchSpec("Parameter", "Log directory");
taskParam_BC.ExecuteQuery(1);
taskParam_BC.FirstRecord();


var compName = serverSession_BC.GetFieldValue("CC_ALIAS");
var siebsrvrName = serverSession_BC.GetFieldValue("SV_NAME");
var task_id = serverSession_BC.GetFieldValue("TK_TASKID");
var p_id = serverSession_BC.GetFieldValue("TK_PID");
var logDir = taskParam_BC.GetFieldValue("Current Value");


Additionally one can also find the windows process id and thread id by using following script.

var processId, taskId;
processId = taskId = ""; // initialize to satisfy eScript parser

//evaluate to suppress STDCALL not being recognized with eScript parser
eval('processId = SElib.dynamicLink("kernel32.dll","GetCurrentProcessId", STDCALL)');
eval('taskId = SElib.dynamicLink("kernel32.dll","GetCurrentThreadId", STDCALL)');

processId = processId.toString();
taskId = taskId.toString();

I bet you wont be able to do this in any cloud application. :)

Hope it helps.