Tuesday, April 28, 2009

FirstRecord() in PreCanInvoke Event : Refresh Issue

Today I am going to tell you about an interesting issue that we faced in our Production Env and really worked hard to figure it out the root cause for it.


The issue was :

On Activity Form applet, we have "Comments" field, which is 2000 characters long and user to write a detail description in this field related to that activity record. Now few of the users faced the issue that "while typing some text in Comments field, suddenly the whole text written get deleted and Comments field become blank". User get frustrated as he need to type in the whole text again and also the next time not sure whether he will able to complete putting text in Comments field or not. For a temporary workaround they used to first type in all the text in a NotePad file and then copy paste the complete text at once in Comments field and save the record.

What we tried :

When we tried replicating this issue in our dedicated env, we were unable to replicate it. After lot much of effort our QA Team was able to replicate it sometimes on our thin client. But the problem was this is not always happening with them as well. On some of the machines we were not able to replicate it at all. Totally a random behaviour.

Now the problem was to find out the steps so that we can replicate it. We have one option to try i.e. by disabling all the Server Script and check if we can replicate the issue in thin client (since in dedicated client everything was working fine).

We changed the "EnableScripting" = False and restart the Siebel server, and found that the issue is not coming anymore. So we narrowed down for the root cause of the problem to Scripting.


And, here is what we finally found :

On PreCanInvoke method of the applet we had a script written, something like :


if (MethodName == "Test")
{
if(this.BusComp().FirstRecord())
CanInvoke = "True";
return (CancelOperation);
}


So, what was happening when user was typing some text in Comments field, it seems like IE web page get refreshed and due to this the code written on "PreCanInvoke" method was getting invoked and due to the "FirstRecord()" method used inside the code, the current record get refreshed and resulting in no text in Comments field.

Finally, we were able to find the root cause of the problem, now its the time to look for some workaround. So we decided not to enable/disable button using PreCavInvoke script, rather put a check message in PreInvoke method when there is no record displayed. So here below is final version of script we used :

PreCanInvoke Method

if (MethodName == "Test")
{

CanInvoke = "True";
return (CancelOperation);

}


PreInvoke Method :

if(MethodName == "Test")
{
if(this.BusComp().FirstRecord())
{
TheApplication().RaiseErrorText("This operation is not valid, when record is not displayed");

}
return (CancelOperation);
}


Recommendation:
Avoid writing scripting on PreCanInvoke Method of Applet, as this is the event which fires on each and every action we do on the applet + at the time of automatic refresh of web page.

Sunday, April 26, 2009

Scheduling Automatic Export in Siebel

List applets provide the OOB export functionality which is very useful sometimes when Managers want to do some analysis depending on various combinations and permutations on the live data very quickly. But if you need to do the same task on the daily basis, you will think, can't I get the export automatically from Siebel via email instead of I go to the list applet and take the export. The same happened with my client too. He want to automate this export process that he generally does on the daily basis from All Service Requests List Applet.

Lets see how this is achievable :

On the very high level, the solution is to :
  1. Create a Workflow which can take the Export and send it in an email to the user.
  2. Create a RCR (Repeating Component Request) which will get executed on the daily basis and run a workflow.

Workflow Creation:


Here below are major steps that used in Workflow to acheive the solution.

  • Query Service Request
    Business Service Name = Import/Export
    Business Service Method = Export
    Input arguments for this step are as follows :

    ==> FileName : "<_filename.xls>" (for eg: /temp/export.xls). Please make sure you should provide the extension as .xls

    ==> FileType: XML

    ==> IntObjectName : Service Request (this is the IO that I have created which has only one Integration Component i.e. Service Request). You can also use the OOB available IO for this purpose, if fits into the requirement.


  • Send Email
    Business Service Name : Outbound Communications Manager
    Business Service Method Name : SendMessage
    Input arguments for this step are as follows :

    ==> MsgToList : "<_youremailaddress>"

    ==> CommProfile : "<_communicationprofilename>". if you want to know, how to setup a Communication Profile, please refer to :
    http://siebelmantra.blogspot.com/2009/04/how-to-setup-communication-profile-for.html

    ==> MsgSubject : Export from Siebel

    ==> MsgBody : This is the test export from Siebel

    ==> AttachFileList : <_filename.xls>. (for eg: /temp/export.xls).

Workflow is ready, Publish and Activate it and simulate it on the Server to check if running fine.

RCR (Repeating Component Request) Creation :

Here below are the steps for creating the RCR job and let the Workflow run on the daily basis.

  • Navigate to "Administration-Management -> Jobs" view.
  • Click on "New" and select "Component/Job" = "Workflow Process Manager".
  • Under Repeating Info section, select the following :
  • Under Job Parameters applet, create a new select with the following info :
    Workflow Process Name : <_name>
  • Click on "Submit Job"

And you are done with the complete process. Siebel will automatically take the export and send you the file on the daily basis.

Enjoy !!!!


Friday, April 24, 2009

How to setup a Communication Profile for sending email from Siebel ?

I was working on our Sandbox Env, that we have newly setup for some R&D purpose, and got the requirement to send an email from Siebel via F9 functionality. Since it is a new env, nothing has been setup on that from administration standpoint, so I need to start from the scratch to setup a communication profile. So let me tell you today what all you to do for this :

  1. Navigate to "Administration - Communications -> Communication Profiles & Drivers" view.
  2. Query for "Internet SMTP/POP3 Server" under Communications Drivers applet.
  3. Create a new Profile. Lets say "Test Email Profile".
  4. Under Profile Parameter Overrides applet, add the following parameters :
    ==> From Address : Any Email Address (Generally it should be Siebel Email box Id )
    ==> SMTP Server : Name of the SMTP Server which will send the email.
    ==> SMTP Server Port : 25
  5. Click on "Menu" button on "Profiles" applet and click on "Submit Profile Changes".
  6. Uptill this point you are ready to use this communication profile but before this need to check whether Server Component, responsible for executing the email request are running properly or not. So continue with the next step.
  7. Navigate to "Administration-Configuration -> Enterprises -> Component Groups" and query for "Communications Management" under component groups applet and then query for "Communications Outbound Manager" component under "Components" applet. This is the component which is responsible for sending outgoing emails from Siebel.
  8. Check if "Enabled on Server" flag is checked under "Component Group Assignments" applet. If not click on "Enable" button.
  9. Navigate to "Administration-Configuration -> Enterprises -> Component Definitions" and query for "Communications Outbound Manager".
  10. Set the following two parameters to "Test Email Profile" (Communication profile created in Step# 3)
    ==> Comm Profile Override
    ==> Communication Profile
  11. Click on "Synchronize" button.
  12. Now restart the Siebel server.
  13. Navigate to Tools -> User Preferences -> Outbound Communications view and select "Siebel Email Client" in Email Client. Click on Save.


And you are done with the profile creation and hopefully it should work fine. Lets test it out.

Navigate to Service Request Screen -> My Service Requests view, Click F9 and system will give you the Popup form to send an email. Put your email address in "To" section and fill in the subject and body as per your wish and send it.

Check your Inbox, you will see the email in few minutes. Also drilldown on SR# field and navigate to "Activities" view, you will an activity of type "Email - Outbound" and the contents of the email in Comments field. This is Siebel OOB functionality of creating activity under Service Request whenever you send an email from Service Request record.

Troubleshooting :

Let me tell you about the error which is most likely to occur while sending emails from Siebel once you have setup a new Communication Profile. What happens is you followed above steps and still not received any email. Go to "Administration-Management" Drilldown on Component "Communications Oubound Manager" and check the log. You may see the error : "Client does not have permission to submit mail to this server".
This error most likely occur when there exist a firewall between your Siebel server and SMTP server, so what happens is Siebel Server is not able to create any email request on the SMTP server. Just talk to your network administrator and get the name of SMTP server without any firewall. It will work.

Hope this helps !!!!!


Friday, April 17, 2009

What you see is what you get @ Siebel

My colleague called me up this morning to show an amazing behaviour that he was observing while working on a Form Applet web layout. Actually he was creating a new applet : "Service Request Form Applet" and creating the web layout for that. He placed various field as per the requirement on the UI and it was lookinng good in Siebel Tools. To be on the safer side right clicked on the web layout of the applet and clicked on "preview" and applet was looking good. Then he asked me, "Eveything is looking fine?", I said, "yes absolutely" and he just smiled and compiled and SRF and showed me the applet in the application and I just got surpised to see that the UI was totally different what I just saw in the web layout of applet in Siebel Tools.

And my reaction was ...... hmmmmm, how it could had happen?? Isn't Siebel follow the "What you see is what you get" science?

I know, you must be thinking that whether we had exposed the correct "Applet Mode" in View Web Template Item or not. OR whether we are working on the applet's "Edit" layout or not. But don't worry, this was not the case :)

Well, both of us started scratching our heads and looking for the cause for it. Lot many things we tried, like a) deleted all controls from the UI b) Added some of the controls c) Changed the Web Layout by placing control on diff diff places...... but nothing worked. Still in the application UI, there is no change.

Lastly we found one OOB tools feature by which you can verify whether what you are placing on the UI is correct or not and most of you already must be knowing .... i.e. "Check Mappings".

So finally we right clicked on the web layout of the applet, clicked on "Check Mappings", and found there was many invalid mappings exists on the applet. System asked me to delete those and I just clicked "Yes" and now created the Web Layout again, compiled the SRF and wwwwooooooooooooo...... yes we were seeing what we were expecting.

We still believe, Siebel follow the "What you see is what you get" science. :)

.

Saturday, April 11, 2009

Siebel @ Youtube........ Enjoy !!!!!!!!


Here is some important information for all of you and I don't think much of the Siebel guys know this, but there are some useful links of youtube which provides some unique capabilities of Siebel new versions. And the best part is these are Vedios available on youtube, we can actually see and observe the Siebel OOB capabilities and provide some good solutions for the customers.

Here you are :

ENjoy !!!!!!!!!!!!

.

Monday, April 6, 2009

BC Read Only Field v/s Parent Read Only Field : A Case Study

We got one requirement to make the Child and Parent Child Applet readonly in a view, if the GrandParent (the applet which is driving the visibility of the view) has got the Status = "Inactive". Sounds interesting, right?

Okayy, let me rephrase it and try to explain you with more details what exactly we want to see.

We have a View in which the following applets are exposed :
a) Accounts Form Applet - Parent
b) Service Request Form Applet - Child
c) Activities List Applet - Grandchild


Accounts applet has a field "Status" exposed on the UI and the requirement is that once Account Status = "Inactive", user cannot do any modification/insertion/deletion on Service Request and Activities applet. Both Child (Service Request) and Grandchild (Activities) applet should become readonly.

I can think of two different User Properties that we can use to achieve this. Lets see the both solution :

First Solution

So, the very first BC user property comes into mind is "BC Read Only Field", which just require a BC Field as a value and depending upon the field's value (Y/N), the BC become readonly. To achieve the solution with this user property, follow the below steps :

a) Create Calc field in Service Request BC:
Field Name : SRReadOnly
Calculated : TRUE
Calc Value : iif(ParentBCName() = "Account" AND ParentFieldValue("Status") = "Inactive", "Y", "N")

b) Create BC User Property in Service Request:
Name : BC Read Only Field
Value : SRReadOnly

c) Create Calc field in Action BC :
Field Name : ActivityReadOnly
Calculated : TRUE
Calc Value : iif(ParentBCName() = "Service Request", ParentFieldValue("SRReadOnly"), "N")

d) Create BC User Property in Action :
Name : BC Read Only Field
Value : ActivityReadOnly


e) Set Link Specification = True for "Status" field at Account BC.

Second Solution

The next BC User property that we can use here is "Parent Read Only Field", which can be used as follows :

Name : Parent Read Only Field: <_parentbuscompname>
Value : <_parentfieldname>


a) Create a calc field on Account BC :
Name : AccntInactive
Calc : TRUE
Calc Value : iif([Status] = "Inactive", "Y", "N")


b) Create a BC User Property in Service Request :
Name : Parent Read Only Field: Account
Value : AccntInactive


c) Create a calc field on Service Request BC :
Name : AccntInactive
Calc : TRUE
Calc Value : iif(ParentBCName() = "Account", ParentFieldValue("AccntInactive"), "N")


d) Create BC User Property in Action :
Name : Parent Read Only Field: Service Request
Value : AccntInactive


Compile the SRf after using each solution and observe the changes by setting Account Status Active/Inactive.

If you would compare the two solution, both looks same from configuration perspective as both require two calc fields and two user properties in all. But from scalability standpoint, second solution is better as you can easily use as many instances of "Parent Read Only Field" you want, in case Activities/Service Request need to show read only, when exposed under some other Parent BC like Opportunity, Quote etc. While in case of "BC Read Only field" you need to accomodate the business logic inside the calc field itself, as we can have only one instance of this user property at one time.


Third Solution

I can think of one more solution for this problem by, and I think the most efficient, by using both user property. Here it goes :

a) Create a calc field on Service Request BC :
Name : AccntInactive
Calc : TRUE
Calc Value : iif(ParentBCName() = "Account" AND ParentFieldValue("Status") = "Inactive", "Y", "N")


b) Create a BC User Property in Service Request :
Name : BC Read Only Field
Value : AccntInactive


d) Create BC User Property in Action :
Name : Parent Read Only Field: Service Request
Value : AccntInactive

Third solution, we can actually save one more calc field and solution is achieved by creating 1 Calc field and 2 user properties.

Your comments are most welcome, incase you have any other good ideas around this scenario.

Keep commenting !!!!!

.

Sunday, April 5, 2009

What is difference between Siebel Table Apply & Activate?

Recently, one of my friend asked me a very interesting question, which he has faced in one of the technical interview. Actually that question has two parts :

a) What is the difference between Apply & Activate?
b) What exactly happens in the background when you click on Activate button?

So, here the answer goes :

a) Once you have made changes in the database logical schema i.e. added column/index under Siebel Tools -> Table Object, you need to apply those changes in the physical schema as well. So when we click on "Apply" button, system actually connects to the database and synchronize the logical schema with the physical database for that particular table.

b) Once you click on "Activate" button, system actually goes and update the Application Version table of Siebel i.e. S_APP_VER, and let the Siebel Server know that some modification has been done in DB Schema that needs to be taken care for any future EIM activity or any future DBXtract task. So what happens is whenever such task run on the Siebel Server, since DB schema version has been changed by "Activate" button, system updates the diccache.dat file. In my opinion, this doesn't make any sense if we do "Activate" against local database (Please correct me if I am wrong)

To verify this, follow the steps :
1. Run the below SQL in DBISQLC.exe against Local Database.

select last_upd, CUSTOM_SCHEMA_VER, from siebel.S_APP_VER

2. Go to Siebel Tools and click on "Activate" button for any table.

3. Run the above mentioned SQL query again and see the difference in the values.

Hope this helps.
.

Saturday, April 4, 2009

Extending Tables / Columns in Siebel Local Database

I have started working on new Env these days and due to slow connectivity to the remote database server, I generally connect to my Local Database to see the changes in SRF via dedicated client.

Now while working on one of the requirement I was required to extend one column in Table in local database. So since it was my local database, extratced with my User Credentials, I went into the Siebel Tools -> Tables and here is what I tried :



1. Query for Table.
2. Create the New Column with all the datatype and length details.
3. Clicked on Apply and as used ODBC source : "SSD Local Db default instance". This is the ODBC data source that I have mentioned in Tools CFG to connect to my local Database.
4. Since its my local database, put in Database User : "", Database User Password : "".
5. Clicked on "Apply".



Got surprised to see that, it gave "Permission Denied" error. I was like, "its my database, my tools, in my machine and the same ODBC data source, still its not working......." hmmmmmm

Started looking into the options and workaround, then realized you can only change the Database Schema if you are logging with the Table Owner credentials. And the Table owner of any local database extracted is "Siebel". Soooooo, just tried again applying the table with the same above process, the only parameter I changed was : "Database User = SIEBEL". and yes it WORKED !!!!!



P.S. : The similar process is applicable for Sample Database as well. Database User : "SIEBEL", Database User Password = "SADMIN".

.