July 07, 2016

How to customize siebel error messages?


With IP14 Oracle has provided ErrorObjectRenderer.js to replace browser based dialogs with jQuery based dialogs. Problem with browser based dialogs is that users can accidently disable them. Thus it is not a good place to show error messages or important instructions to the user. 
Standard alert()
However jQuery based dialogs always shows up on the screen and user have to click ok always to get past them.
jQuery Dialog

Lets see how we can achieve the same functionality in IP13.  

Open UI framework uses browser alert() function to popup error messages. In Javascript it is possible to override any function including browser native functions like alert and change it according to the business needs.

Simplest way to override alert is to define a function alert() in your code, this will force your browser to call your custom function all the time whenever Siebel calls alert() instead of browser's native function. .

function alert(str){
 $("<div id='my_error'>" + str + "</div>").dialog({
               modal: true,
                buttons: [{ id: "btn-accept",
                    text: "Ok",
                    click: function () { $(this).dialog("close"); }               
                }]
            });
}

Just add the above code in post load file and job done, after executing this code all the error messages will shown in jQuery dialog which will always pop-up. See it in action on codepen

Happy alerting ! 
This is trick is shared by avid reader TJ, please share your tips and tricks in comments below.

July 03, 2016

WebServices Performance Tuning



Recently I have been working on high traffic and highly available web service which is hosted by Siebel. I was asked to improve performance of it. I checked all the places for any performance degradation clues, there was hardly any, all queries were on indexed columns and thin BC's were used, there was no fat whatsoever.

With all the logs and spool generation my focus went to these two problems. 

1. Before every web service call Siebel was requesting file system to write read user preference file which was taking fair bit of time due to contention at file system. You might see following in logs, if user preference file is corrupted.



ObjMgrLog Debug 5 0 2016-06-29 06:50:56 SharedFileReader: \SiebelFS\userpref\EAIUSER&Siebel Sales Enterprise.spf: Open iteration 0 failed. errcode = 2.


This file read was absolutely unnecessary, luckily there was a way to turn off by setting "OM - Save Preferences" to FALSE for EAI object manager. This will make all logins to avoid looking up for user preference file.

2. Another useless transaction I noticed was with database. It was when Siebel tries to update the last login date on S_USER record. 
In logs you can see queries like these:

UPDATE SIEBEL.S_USER SET
LAST_LOGIN_TS = :7,
MODIFICATION_NUM = :8,
LAST_UPD_BY = :9,
LAST_UPD = :10,
DB_LAST_UPD = current_date,
DB_LAST_UPD_SRC = :11
WHERE
ROW_ID = :12 AND MODIFICATION_NUM = :14;
This can also be turned off in recent Siebel versions by setting DisableLastLoginTS = TRUE 

Its a new parameter introduced by Oracle, you can read more about this parameter on oracle support 1665762.1

Hope it helps. If you have come across any such parameter which can improve performance then please share it in comments below.

June 23, 2016

Just one Elastic applet?

Oracle introduced wonderful elastic list applets with IP16,  this feature shrinks list applet size if there are no or less records needs to be displayed. However this doesn't always looks nice, specially in MVG applets and pick applets.
Default Elastic Applets in IP16
 
This feature can be turned off by setting "Enable Elastic Grid" system preference, but it is turned off for entire application. That makes me think is there any way we can make only one applet as elastic applet?  Answer is yes :)

Neel on Siebel Unleashed published beautiful trick to back port elastic applets into IP15. Absolutely splendid! This trick can be extended to make only few applets Elastic. 

To make all list applets Elastic add following in custom CSS file:
.ui-jqgrid-bdiv{max-height:340px !important; height:auto !important;}
To make only one applet Elastic (After turning of the system preference) add following CSS :
div[title="Line Items List Applet"] div.ui-jqgrid-bdiv { height: auto !important}

By preceding another div selector to the CSS rule we can instruct browser to apply CSS style only if applet name is : "Line Items List Applet". One can use this trick to change other UI attributes for specific applets and apply different styling.


Happy Styling :)