Showing posts with label Miscellaneous. Show all posts
Showing posts with label Miscellaneous. Show all posts

Get Workflow Instance Id from the process property value!

Workflow Instance monitor is one of the best out of the box debugging techniques available in Siebel. But this also lacks in some aspects.

As most of developer would know that there is no way in instance monitor view to identify the workflow instance for specific object id or process property value.

Siebel Product Configurator: How to restrict attribute length?

We have one requirement in our project, that we need to restrict the value of one attribute to five characters only.

In Siebel vanilla application we tried to implement this without doing scripting, but failed.

Solution we used:
This requirement can be achieved in two ways:

1. By Scripting in Attribute Selected event. update or 
2. Creating Custom User Properties for product configurator.

I will be discussing the second solution in this post. It will involve editing of cfgui.js . For more info my older posts 

1. Find the following code in cfgui file.

try to find text: function showtextbox.
Updated Section:
2. Replace the code with :

3. Create user property on the root product like:

and you are done!

Now clear cache of browser and restart the client.

Attribute on which you have defined the property will automatically be constrained by the number of characters that you have provided in property.

Hope its is understandable.

For more info how it worked, look at the maxlength property here.

Debugging Siebel - Creatng custom logs using Clib.fputs

When it comes to debugging Siebel application, no one beats the Siebel vanilla logs (events logs governed by environmental variables), but every developer use his own techniques to debug his configuration.

In this post I am discussing the way I debug my things.

I add following piece of code at every event that I want to monitor, and add my required parameters to it, and then just compile all the objects and run the scenario.

var date = new Date();

var fp = Clib.fopen("d:\\log.txt","a");

Clib.fputs("\n" + " BCPreInvokeMethod" + " " + date,fp);


In above code first line creates a date object that give the timestamp that will be written in the log file. Second line creates a file pointer that opens file/creates file in write mode. In next line Clib.fputs function writes string to the file.

We can now simply alter string according to our requirement, and get the exact output.

This way i get exact view of events and parameters in a flat file, that makes it really easy to understand the actual problem. If you are trying this code then you will get output something like :

PreInvokeMethod SetAspectSun Aug 02 2009 01:52:19

PreInvokeMethod SetAspectSun Aug 02 2009 01:52:19

PreInvokeMethod SetDefaultDurationSun Aug 02 2009 01:52:19

PreCanInvokeMethod DeleteRecordSun Aug 02 2009 01:52:19

PreCanInvokeMethod ShowQueryAssistantSun Aug 02 2009 01:52:19

PreCanInvokeMethod ToggleListRowCountSun Aug 02 2009 01:52:19

PreCanInvokeMethod ExecuteQuerySun Aug 02 2009 01:52:19

PreCanInvokeMethod GotoNextSetSun Aug 02 2009 01:52:19

PreCanInvokeMethod GotoPreviousSetSun Aug 02 2009 01:52:19

PreCanInvokeMethod NewQuerySun Aug 02 2009 01:52:19

PreCanInvokeMethod NewRecordSun Aug 02 2009 01:52:19

PreCanInvokeMethod PositionOnRowSun Aug 02 2009 01:52:19

PreCanInvokeMethod UndoQuerySun Aug 02 2009 01:52:19

PreCanInvokeMethod UndoRecordSun Aug 02 2009 01:52:19

PreCanInvokeMethod WriteRecordSun Aug 02 2009 01:52:19

PreCanInvokeMethod ShowPopupSun Aug 02 2009 01:52:19

PreCanInvokeMethod GetBookmarkURLSun Aug 02 2009 01:52:19

PreCanInvokeMethod FileSendMailSun Aug 02 2009 01:52:19

PreCanInvokeMethod FileSendFaxSun Aug 02 2009 01:52:19

PreCanInvokeMethod FileSendPageSun Aug 02 2009 01:52:19

It can be really helpful if you working on a new siebel application and doesn't know how things work.

Although it takes longer time to get the output, but it really helps when all other options fails.

Siebel Shortcuts!

I prefer most of the things to be automated on my machine and same thing as with siebel. I think most of developers prefer it that way.

In this post i am sharing how we can automate Siebel on our machine and some easy to use shortcuts that can be really helpfull if used.

1. Using automated log in to Siebel Tools and Web client.

It is very boring to enter our same credentials every time we open our Siebel Tools or web client. By using the command line switches provided by siebel we can automate this login process.

See the screen shot showing how we can automate SADIN login to siebel tools for sample database.

Similarly for Web client we can have similat auto login. This way you can create mulple icons for multple dbf's .. These icons when clicked will take direclty tools or web client without any need to log in.

2. Automated login to Siebel Thin Client
Usually most of developer adds thin client URL in IE's favourites. We can also customise this URL to take us direclty to the aplication without showing the loging screen.

Just Add following string after the Thin Client URL and save the as bookmark

start.swe?SWECmd=ExecuteLogin&SWEUserName=[User Name]&SWEPassword=[Password]

Next time you will click this bookmark ... Browser will automatically show the logged in screen.

Siebel has provided feature in siebel tools very similar to favorites in Internet Explorer. We can bookmark any view that we have queried and drilled down in siebel tools, and later in future if we want to go back then we just have click on that bookmark and then tools will show the view exactly where we left it.

Bookmark works on every screen except Workflow Editor View and Script editor view.
4. Other Usefull Shortcuts:
Siebel Tools:
Cntrl +F7 --- Srf compile.
Cntrl+F10 -- Check In Object
Cntrl + E --- Hide Unhide Object viewer
Cntrl + Shift + F9 -- clears all the creak points

SIebel Client:
Alt+Q -- Query
Alt+R -- Refine Query
Cntrl + Shift +X -- -log out
Cntrl + Shift + A --- Go to Site Map
Cntrl + W -- Immediately Kills Active Window.(Use it when going back home :) )
F2 -- Open Pick applets and MVGs
Cntrl + Arrow Up -- Prev Record
Cntrl + Down -- Next Record
Alt + Down -- Next 20 records
Alt + Up --Prev 20 records

Cntrl + 8 -- When siebel client hangs this shortcuts brings back the control to IE, and then you can submit the new requests.

Coming up : Automation of daily siebel server admin tasks.

Browser Script on fly!

This was almost a year ago, myself along with Neel and other team members were working on product configurator and found vulnerability in the siebel browser script.

Like other web applications, In Siebel also we can inject some javascript in page to extract details or modify some element.  But as siebel has provided access to the theApplication() object in the  browser script.  We could access it in script in address bar. 

Once this object was availble, we were able to set and get profile attribute at any view in the siebel session.

That's not all !!  Siebel script engine doesn't defferentiate between a browser script and server script. The only difference is that in browser script user can only work on the objects that are shown on the current UI.

This means that we can edit the read only fields, those fields that were made readonly at applet level.

I digged some more and uploaded some scripts that can be used readily in any application. 

Try one of the followings: 
(Open siebel application and copy paste the content in the address bar and click GO.) 




Other Siebel Blogs

siebel-admin-l @ IT - toolbox

siebel-dev-l @ IT - toolbox