Friday, December 23, 2011

Happy Christmas and a Prosperous New Year

I'm getting ready for my seasonal break today, so I wanted to take this opportunity to wish all my readers a Very Happy Christmas!
Even if you don't celebrate the religious festival, I hope you enjoy the festive period. Thank you for reading at least some of my blog posts this year, and contributing to some very interesting requirements. I haven't been able to write something new lately, but you ca be sure of some pretty cool posts next year, Stay tuned!
























And, if you haven't noticed already...Its snowing :)

Once again, we wish you an absolute cracker of a Christmas and a Great New Year, full of happiness!

Thursday, September 8, 2011

Tips 'n Tricks for Oracle CRM On Demand

An excellent free book providing tips and tricks fro improving your Oracle CRM On Demand application. - by Mathieu Emanuelli and Joann Alejandro Bravo



Cheers!

Friday, August 26, 2011

Generating Data to UI mappings in Siebel just got easier!

This is one of those tasks which is fairly simple to do. However, can be very time consuming considering you have to generate a mapping for an entire/multiple repositories. We've all have had to do this at some point, not enjoying it one bit!

Well, here is a code that will save you some time and your sanity :).

The below code generates a screen to Applet, and an Applet to BC mapping which can be then exported to excel.


Screen to Applet - 


select scr.name "Screen Name"
      ,nvl(nvl(ptabi.tab_text, scri.viewbar_text), scr.viewbar_text) "Screen"
      ,scrv.sequence "View Seq"
      ,vw.name "View Name"
      ,vwi.title "View"
      ,vw.busobj_name "Business Object"
      ,vwti.item_num "Item Num"
      ,ap.name "Applet Name"
      ,api.title "Applet"
      ,ap.buscomp_name "Business Component"
from   siebel.s_repository rep
       inner join siebel.s_screen scr on scr.repository_id = rep.row_id
       left outer join siebel.s_screen_intl scri on scri.screen_id = scr.row_id and scri.repository_id = rep.row_id and scri.name = 'ENU-STD'
       inner join siebel.s_screen_view scrv on scrv.screen_id = scr.row_id and scrv.repository_id = rep.row_id
       inner join siebel.s_application appl on rep.row_id = appl.repository_id
       left outer join siebel.s_page_tab ptab on ptab.application_id = appl.row_id and ptab.repository_id = rep.row_id and ptab.screen_name = scr.name
       left outer join siebel.s_page_tab_intl ptabi on ptabi.page_tab_id = ptab.row_id and ptabi.repository_id = rep.row_id and ptabi.name = 'ENU-STD'
       inner join siebel.s_view vw on vw.name = scrv.view_name and vw.repository_id = rep.row_id
       left outer join siebel.s_view_intl vwi on vwi.view_id = vw.row_id and vwi.repository_id = rep.row_id and vwi.name = 'ENU-STD'
       inner join siebel.s_view_web_tmpl vwt on vwt.view_id = vw.row_id and vwt.repository_id = rep.row_id
       left outer join siebel.s_view_wtmpl_it vwti on vwti.view_web_tmpl_id = vwt.row_id and vwti.repository_id = rep.row_id
       inner join siebel.s_applet ap on ap.name = vwti.applet_name and ap.repository_id = rep.row_id
       left outer join siebel.s_applet_intl api on api.applet_id = ap.row_id and api.repository_id = rep.row_id and api.name = 'ENU-STD'
where  rep.name = 'Siebel Repository'
and    appl.name = 'Siebel Power Communications'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(scr.inactive_flg,'N') = 'N'
and    nvl(scri.inactive_flg,'N') = 'N'
and    nvl(scrv.inactive_flg,'N') = 'N'
and    nvl(vw.inactive_flg,'N') = 'N'
and    nvl(vwi.inactive_flg,'N') = 'N'
and    nvl(vwt.inactive_flg,'N') = 'N'
and    nvl(vwti.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(api.inactive_flg,'N') = 'N'
union
select scr.name "Screen Name"
      ,nvl(nvl(ptabi.tab_text, scri.viewbar_text), scr.viewbar_text) "Screen"
      ,scrv.sequence "View Seq"
      ,vw.name "View Name"
      ,vwi.title "View"
      ,vw.busobj_name "Business Object"
      ,vwti.item_num "Item Num"
      ,apta.name "Applet Name"
      ,api.title "Applet"
      ,apta.buscomp_name "Business Component"
from   siebel.s_repository rep
       inner join siebel.s_screen scr on scr.repository_id = rep.row_id
       left outer join siebel.s_screen_intl scri on scri.screen_id = scr.row_id and scri.repository_id = rep.row_id and scri.name = 'ENU-STD'
       inner join siebel.s_screen_view scrv on scrv.screen_id = scr.row_id and scrv.repository_id = rep.row_id
       inner join siebel.s_application appl on rep.row_id = appl.repository_id
       left outer join siebel.s_page_tab ptab on ptab.application_id = appl.row_id and ptab.repository_id = rep.row_id and ptab.screen_name = scr.name
       left outer join siebel.s_page_tab_intl ptabi on ptabi.page_tab_id = ptab.row_id and ptabi.repository_id = rep.row_id and ptabi.name = 'ENU-STD'
       inner join siebel.s_view vw on vw.name = scrv.view_name and vw.repository_id = rep.row_id
       left outer join siebel.s_view_intl vwi on vwi.view_id = vw.row_id and vwi.repository_id = rep.row_id and vwi.name = 'ENU-STD'
       inner join siebel.s_view_web_tmpl vwt on vwt.view_id = vw.row_id and vwt.repository_id = rep.row_id
       left outer join siebel.s_view_wtmpl_it vwti on vwti.view_web_tmpl_id = vwt.row_id and vwti.repository_id = rep.row_id
       inner join siebel.s_applet ap on ap.name = vwti.applet_name and ap.repository_id = rep.row_id
       inner join siebel.s_applet_toggle apt on apt.applet_id = ap.row_id and apt.repository_id = rep.row_id
       inner join siebel.s_applet apta on apta.name = apt.applet_name and apta.repository_id = rep.row_id
       left outer join siebel.s_applet_intl api on api.applet_id = apta.row_id and apta.repository_id = rep.row_id and api.name = 'ENU-STD'
where  rep.name = 'Siebel Repository'
and    appl.name = 'Siebel Power Communications'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(scr.inactive_flg,'N') = 'N'
and    nvl(scri.inactive_flg,'N') = 'N'
and    nvl(scrv.inactive_flg,'N') = 'N'
and    nvl(vw.inactive_flg,'N') = 'N'
and    nvl(vwi.inactive_flg,'N') = 'N'
and    nvl(vwt.inactive_flg,'N') = 'N'
and    nvl(vwti.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(api.inactive_flg,'N') = 'N'
order by "Screen"
        ,"View Seq"
        ,"View Name"
        ,"Item Num"
        ,"Applet Name"


Output looks like -








Applet to BC mapping -

select  "Applet Name"
,"BC Name"
,"BC Field"
,"Required"
,"Calculated"
,"Calculated Value"
,"Join Name"
,"Table"
,"Column"
,"Data Type"
,"Length"
,"Multi-valued"
,"MV Link"
,"Pick List"
,"LOV Name"
,min("Caption") "Caption"
,"Display Order"
from (
select ap.name "Applet Name"
      ,bc.name "BC Name"
      ,fld.name "BC Field"
      ,fld.required "Required"
      ,fld.calculated "Calculated"
      ,fld.calcval "Calculated Value"
      ,fld.join_name "Join Name"
      ,(case when fld.mvlink_name is null then nvl(nvl(jotab.name, fld.join_name), case when fld.calculated = 'Y' then null else bc.table_name end) else null end) "Table"
      ,fld.col_name "Column"
      ,fld.type "Data Type"
      ,(case when fld.prec_num is null then to_char(fld.textlen)
             else to_char(fld.prec_num) || to_char(case when fld.scale is null or fld.scale = 0 then '' else ',' || fld.scale end)
        end) "Length"
      ,fld.multi_valued "Multi-valued"
      ,fld.mvlink_name "MV Link"
      ,pl.name "Pick List"
      ,pl.type_value "LOV Name"
      ,coi.caption "Caption"
      ,co.sequence "Display Order"
from   siebel.s_control co
       inner join siebel.s_control_intl coi on coi.control_id = co.row_id and coi.name = 'ENU-STD'
       inner join siebel.s_applet ap on co.applet_id = ap.row_id
       inner join siebel.s_buscomp bc on ap.buscomp_name = bc.name
       inner join siebel.s_field fld on fld.name = co.field_name and fld.buscomp_id = bc.row_id
       inner join siebel.s_repository rep on bc.repository_id = rep.row_id
       left outer join siebel.s_join jo on jo.buscomp_id = fld.buscomp_id and fld.join_name = jo.name
       left outer join siebel.s_table jotab on jotab.name = jo.dest_tbl_name and jotab.repository_id = rep.row_id
       left outer join siebel.s_picklist pl on fld.picklist_name = pl.name and pl.repository_id = rep.row_id
where  rep.name = 'Siebel Repository'
and    ap.repository_id = rep.row_id
and    co.repository_id = rep.row_id
and    bc.repository_id = rep.row_id
and    fld.repository_id = rep.row_id
and    nvl(co.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(bc.inactive_flg,'N') = 'N'
and    nvl(fld.inactive_flg,'N') = 'N'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(jo.inactive_flg,'N') = 'N'
union all
select ap.name "Applet Name"
      ,bc.name "BC Name"
      ,fld.name "BC Field"
      ,fld.required "Required"
      ,fld.calculated "Calculated"
      ,fld.calcval "Calculated Value"
      ,fld.join_name "Join Name"
      ,(case when fld.mvlink_name is null then nvl(nvl(jotab.name, fld.join_name), case when fld.calculated = 'Y' then null else bc.table_name end) else null end) "Table"
      ,fld.col_name "Column"
      ,fld.type "Data Type"
      ,(case when fld.prec_num is null then to_char(fld.textlen)
             else to_char(fld.prec_num) || to_char(case when fld.scale is null or fld.scale = 0 then '' else ',' || fld.scale end)
        end) "Length"
      ,fld.multi_valued "Multi-valued"
      ,fld.mvlink_name "MV Link"
      ,pl.name "Pick List"
      ,pl.type_value "LOV Name"
      ,coi.display_name "Caption"
      ,co.sequence "Display Order"
from   siebel.s_list li
       inner join siebel.s_applet ap on li.applet_id = ap.row_id
       inner join siebel.s_list_column co on co.list_id = li.row_id
       left outer join siebel.s_list_col_intl coi on coi.list_column_id = co.row_id and coi.name = 'ENU-STD'
       inner join siebel.s_buscomp bc on ap.buscomp_name = bc.name
       inner join siebel.s_field fld on fld.name = co.field_name and fld.buscomp_id = bc.row_id
       inner join siebel.s_repository rep on bc.repository_id = rep.row_id
       left outer join siebel.s_join jo on jo.buscomp_id = fld.buscomp_id and fld.join_name = jo.name
       left outer join siebel.s_table jotab on jotab.name = jo.dest_tbl_name and jotab.repository_id = rep.row_id
       left outer join siebel.s_picklist pl on fld.picklist_name = pl.name and pl.repository_id = rep.row_id
where  rep.name = 'Siebel Repository'
and    li.repository_id = rep.row_id
and    ap.repository_id = rep.row_id
and    co.repository_id = rep.row_id
and    bc.repository_id = rep.row_id
and    fld.repository_id = rep.row_id
and    nvl(li.inactive_flg,'N') = 'N'
and    nvl(co.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(bc.inactive_flg,'N') = 'N'
and    nvl(fld.inactive_flg,'N') = 'N'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(jo.inactive_flg,'N') = 'N'
)
group by  "Applet Name"
,"BC Name"
,"BC Field"
,"Required"
,"Calculated"
,"Calculated Value"
,"Join Name"
,"Table"
,"Column"
,"Data Type"
,"Length"
,"Multi-valued"
,"MV Link"
,"Pick List"
,"LOV Name"
,"Display Order"
order by "Applet Name"
        ,"BC Name"
        ,"MV Link" desc
        ,"Table"
  ,"Display Order"

Output looks like -








So there you go...you could later consolidate both to have a full UI to Data level mapping.

Oh! Almost forgot, Your welcome ;)

Cheers!

Thursday, July 14, 2011

How to Integrate Google maps with Siebel for multiple addresses

A few days back a client asked me if we could have Google maps integrated with their Siebel application, that would enable their reps to locate their contacts/accounts on Google maps, and find the best way to reach them based on their mode of commute. Initially, they had planned to do this for single addresses. However, I tried to convince them to go for multiple address selection.

The key business driver here in my opinion would be that, the user can optimize his/her travel route based on the proximity of his/her reps, thus saving time and money. Google maps also offers a few more features like checking for traffic, avoiding tolls, taking highways etc.

Google maps is really cool, and integrating it with Siebel makes it cooler ;)

Really!! show me how?

Step 1: The first step would be to get the Google map applet setup on your Siebel application. There are many ways to do this. For this example lets go with Mash-up your CRM with Google maps in < 30 minutes.

Step 2: Once you have this setup, just copy the below script on the contact/ account list applet or where ever you would like to have this integrated.

The below script will automatically refresh your Google map to give you a route of your selected contact addresses and will plot A, B, C pins on the map. Alternatively, you could also use a button to invoke this script.

Script -

 

































Step 3: Make sure you change the field names in the script to match your contact BC. 
Step 4: Compile and test!

This is what map would look like






















Almost forgot, Thanks to Benny and Alex for their post on Siebel Essentials

Cheers!

Wednesday, May 25, 2011

Multiple Email Validation Script in Siebel

This post is a result of my sheer frustration for not getting this right in a 100 tries. I had been trying to validate the email addresses being entered in Siebel. I tried a lot of ways to get it to work (Data Validation Manager, Runtime events, Configuration etc) but the darn thing would just not work. I had to ultimately resort to the "boo hoo"- Script!

I thought this would be useful for a lot of Siebel guys out there, will save you from all that frustration.(Checks/validates for a comma separated list of emails as well)

Code:

function BusComp_PreWriteRecord ()
{
    try
    {
        this.ActivateField("Email Address");
        if (this.GetFieldValue("Email Address") != "")
        {
            var sEmail = this.GetFieldValue("Email Address");
            var sPattern = /((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*([, ])*)*/;
            var isValid = sEmail.replace(sPattern,"Y");
            if(isValid != "Y")
            {
                TheApplication().RaiseErrorText("Please enter a valid email address");
                return (CancelOperation);
            }
            else
                return (ContinueOperation);
            }
        else
            return (ContinueOperation);
    }
    catch (e)
    {
        throw (e);
    }
    finally
    {
        sEmail = null;
        sPattern = null;
        isValid = null;
    }
}

And last but not least. I must give credit to this post which was the only one that actually worked for me. 
Regular ​Expression ​for ​multiple ​email ​validation

Tip: It is advisable to try out string manipulation, validation scripts in a script simulator before coding it in Siebel. Saves you a lot of time and effort.(for eScript you could use the W3Schools JavaScript Simulator)

Cheers!

Tuesday, April 19, 2011

Siebel Power User - Part 1

Hey Folks,

Here is the first of the many Siebel power user series to come. Just recently discovered a few cool features in Siebel from an end user perspective.

Many a times the user is required to update multiple records of data based on a condition, that the user would normally not know how to execute simultaneously.

For instance, I recently had to update a few(not really) activities in Siebel under a condition where the activity had just one contact associated to it. How would an end user go about making this change?

Lets discuss two such "Good to knows" in the following scenario

The Requirement -
Lets say you have to update the status of 100 or so activities which do not have more than one contact.

The Trick -
Go to the Activities applet, and use the below query on the Contacts field
Count("Contact") > 1

Note: Contact is the MVL used in the Contact MVG









This will give you all activities with more than one contact association.

Now, lets update the Type of the Activities to 'Call'

Select all records and click the Edit option in the application menu and select change records. Change records allows you to update a maximum of 4 fields of the same record simultaneously.





















Select Type in Field 1 and change the value to 'Call Back'
 













And there you go, you now have 15 more minutes to facebook ;)

Please feel free to use the comments section for any feeback on this post, or if you would like to contribute to this series.

Cheers!


Tuesday, January 18, 2011

Setting a Default Template in an Applet To Be Used With Send Email (F9)

Hey Guys,

Its been a while since my last post, apologies for the same. I have been trying to do too many things at the same time :P

While doing some extensive research on Siebel's f9 send email functionality, I came across this cool feature.

So if your business uses a common template to send out to its contacts from a specific applet, this feature could prove useful to you - saves you the effort of manually selecting the template.

Here is how you can add a Default Email Template to your applet.

Step 1: Query for the desired applet you want to set up the email template for.

Step 2: Goto View > Windows > Properties Window.

NOTE: If you are using Siebel versions prior to 8.x. You do not have to open the applet properties window. You should see it as part of the properties for the applet in OBLE.

Step 3: In the Mail Template property enter the Email template name exactly the way it appears in the Siebel Client.
























Step 4: Compile and test - Now when you are on the just modified applet and hit F9, you should see the template pre-populated in the template selection dialog.

Note: Setting a default template for the Send Email command, as described above, overrides template visibility by channel. For example, if a template is specified as the default email template for Change Request applets, this same template will also be the default template for these applets for the fax channels (using the Send Fax command).

Cheers!
Share/Bookmark