21 March 2010

Siebel: Querying for Distinct Records

Many a time during Siebel configuration, one is left wondering "so near yet so far" - to SQL that is. A recent scenario had this problem - send alerts to the activity's account's team members when it is past the due date. Sending more than one email for one or more pending activity is
not acceptable. One of the common things that we do when confronted with this problem is to just write a workflow or a piece of code somewhere that can:
  1. Query for all activities past the due date

  2. For each activity, get the account and query for the
    account's position team

  3. For each member of the team, get the corresponding primary
    employee

  4. Send notification/alerts and flag him to be ignored in
    future

Looking at this problem from a different angle, the solution
is somewhat more simple - get unique "account team member" - "activity"
combination that will be the potential notification candidate. Siebel
provides a "Distinct" property on business components that helps us to
achieve just this. Note that this property enforces a "DISTINCT" clause
on all fields present in the BC, which may force us to create a clone
when needed. Let us re-look at the solution now:
  1. Create a BC based on S_EVT_ACT and with the following
    fields:
    • Due Date (DUE)
    • Status (EVT_STAT_CD)
    • Account Id (OU_ID)
    • Account Primary Position Id (S_ACCNT_POSTN.POSITION_ID)
      • Join: S_EVT_ACT.OU_ID = S_ACCNT_POSTN.OU_EXT_ID)
    • Account Primary Employee Email (S_CONTACT.EMAIL_ADDR)
      • Join: S_ACCNT_POSTN.POSITION_ID = S_POSTN.PAR_ROW_ID
      • Join: S_POSTN.PR_EMP_ID = S_CONTACT.PAR_ROW_ID

  2. Enable "Distinct" flag on this BC

  3. Create a simple workflow based on a business object which
    has the above BC as primary and which leverages the ""Outbound
    Communications Manager" service

  4. Create a "Repeating Component Request" with the required
    search criteria - "[Due] = Today() AND [Status] = 'Open'"

Well, how is that? Of course both have the same number of steps and the second one actually looks more pronounced. But if you have done a fair bit of coding and solutions to problems such as these you know what to choose.

06 March 2010

Siebel: Batch Script to Compile and Replace SRF

Well, I have been absent - you can't really blame me since I had nothing to say. But I am back and hope that matters at least a bit.

My recent work involved some digging around to compile SRF frequently and was surprised that there was hardly any ready-made way to do that. This is the state even though Siebel has been providing 'command line' syntax to do a number of things using Tools. So the following batch script was born for Microsoft Windows OS. It is not really that difficult to achieve it for other operating systems if you apply your mind a bit. I can no way call this script as my own, it is just putting together of many pieces. A brief explanation follows for the uninitiated.

The complete script can be found at the end of this post. To make it run just open notepad > copy the entire script and save the file as "CompUp.bat". If you just double click the file, there is no log created. It will be mighty helpful for the script to create appropriate logs - this will do it:
"d:\sba81\Compile\CompUp.bat 1>>d:\sb\Compile\CompUp.log 2>>&1"

Let us look at individual sections of the script:

Initiation
Set a few variables which can change across environments.
@set SBL_ROOT=d:\sba81
@set SBL_TOOLS_ROOT=d:\sba81\tools
@set SRF_BACKUP=d:\sba81\Compile\SRFArchive
@set SRF_FOLDER=%SBL_ROOT%\siebsrvr\objects\enu
@set BSCRIPT_FOLDER=%SBL_ROOT%\siebsrvr\webmaster\enu

@set OLD_SRF=siebel_sia.srf
@set NEW_SRF=siebel_sia-%TODAY:~10,4%%TODAY:~4,2%%TODAY:~7,2%%NOW:~0,2%.srf
@set CFG=%SBL_ROOT%\siebsrvr\bin\enu\epharma.cfg

@set SIEBEL_SERVER="my_Siebsrvr"
@set WEB_SERVER="my_Webserver"
Most of it is standard stuff, you might observe that the NEW_SRF is named such that repeated compiles on a single day will not cause any harm - assuming each compile takes at least an hour to complete. Pick any CFG of your choice. Siebel server, web server and gateway parameters are copied from the service names. To view service names go to Windows Start Menu > Run > Type 'services.msc' > Hit OK. In services windows go to 'Properties' of the appropriate service and locate the name - these do not have spaces.

Compile
Next comes the actual compile - use Siebel Tools command line options to initiate compile. When the batch file is being executed, you may actually see Tools open up, compile SRF and close.
@ECHO %DATE% %TIME%: Compile SRF with %SBL_TOOLS_ROOT%\bin\enu\tools.cfg
@%SBL_TOOLS_ROOT%\bin\siebdev.exe /c %SBL_TOOLS_ROOT%\bin\enu\tools.cfg /d ServerDataSrc /u /p /bc "Siebel Repository" %SRF_BACKUP%\%NEW_SRF%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

One obvious point here is that you need Tools to be installed on the server. If you are using a box that cannot have Tools (or using other operating systems), you may need to write additional statements to telnet (or something similar) to the Tools box, compile SRF and transfer the same to Siebel server machine. If everything runs fine you will have the SRF compiled, hurray! On the other hand, if there is an error the batch execution just stops without executing further statements. These are scattered throughout the script to direct batch execution in case of errors.

Replace SRF
Now, stop the server to enable us to replace SRF.
net stop %SIEBEL_SERVER%
@sleep 120
The sleep is required to wait for the server to actually stop. During execution you may note that 'net stop' command tells us that the service could not be stopped. What really happens is that it waits for too small a time for server to come down. 'sleep' can hold the further execution till defined time (120 seconds) to enable the siebel server to completely shutdown. Next step: replace srf.
move /y %SRF_FOLDER%\%OLD_SRF% %SRF_BACKUP%\%NEW_SRF%_old
move /y %SRF_BACKUP%\%NEW_SRF% %SRF_FOLDER%\%OLD_SRF%
Copy the newly compiled SRF to Siebel server, while rename the old SRF to denote the SRF it was replaced with. Next generate browser script:
%SBL_ROOT%\siebsrvr\bin\genbscript %CFG% %BSCRIPT_FOLDER%
and start Siebel server:
net start %SIEBEL_SERVER%
Just in case you were wondering, we don't need to wait for the Siebel server to actually startup. Restart Web Server service to put the new browser script in action.
@REM net stop %WEB_SERVER%
@REM net start %WEB_SERVER%
As an alternative you can always follow the SWE command route to refresh browser scripts. Well, that was easy wasn't it?

Complete Script
You can download the batch file here.
@REM Compile and Upload Utility - Batch file to compile SRF and 'activate' it on Siebel server
@REM This is the Windows version! Use command "d:\sba81\Compile\CompUp.bat 1>>d:\sb\Compile\CompUp.log 2>>&1" to redirect o/p & error to log
@REM

@set COMPUP_LOG=d:\sba81\Compile\CompUp.log

@ECHO ====================================================================================================================
@ECHO %DATE% %TIME%: CompUp starting up..
@ECHO %DATE% %TIME%: Set variables

@set TODAY=%Date: =0%
@set NOW=%Time: =0%
@set SBL_ROOT=d:\sba81
@set SBL_TOOLS_ROOT=d:\sba81\tools
@set SRF_BACKUP=d:\sba81\Compile\SRFArchive
@set SRF_FOLDER=%SBL_ROOT%\siebsrvr\objects\enu
@set BSCRIPT_FOLDER=%SBL_ROOT%\siebsrvr\webmaster\enu

@set OLD_SRF=siebel_sia.srf
@set NEW_SRF=siebel_sia-%TODAY:~10,4%%TODAY:~4,2%%TODAY:~7,2%%NOW:~0,2%.srf
@set CFG=%SBL_ROOT%\siebsrvr\bin\enu\epharma.cfg

@set SIEBEL_SERVER="my_Siebsrvr"
@set WEB_SERVER="my_Webserver"

@ECHO %DATE% %TIME%: Compile SRF with %SBL_TOOLS_ROOT%\bin\enu\tools.cfg
@%SBL_TOOLS_ROOT%\bin\siebdev.exe /c %SBL_TOOLS_ROOT%\bin\enu\tools.cfg /d ServerDataSrc /u /p /bc "Siebel Repository" %SRF_BACKUP%\%NEW_SRF%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

@ECHO %DATE% %TIME%: Stop Siebel server %SIEBEL_SERVER%..
net stop %SIEBEL_SERVER%
@sleep 120
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

@ECHO %DATE% %TIME%: Copy SRF
move /y %SRF_FOLDER%\%OLD_SRF% %SRF_BACKUP%\%NEW_SRF%_old
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER
move /y %SRF_BACKUP%\%NEW_SRF% %SRF_FOLDER%\%OLD_SRF%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

@ECHO %DATE% %TIME%: Generate browser script
%SBL_ROOT%\siebsrvr\bin\genbscript %CFG% %BSCRIPT_FOLDER%

@ECHO %DATE% %TIME%: Start Siebel server %SIEBEL_SERVER%
net start %SIEBEL_SERVER%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

@REM ECHO %DATE% %TIME%: Restart Webserver %WEB_SERVER%
@REM net stop %WEB_SERVER%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER
@REM net start %WEB_SERVER%
@IF %ERRORLEVEL% NEQ 0 GOTO ERR_HANDLER

@GOTO End

:ERR_HANDLER
@ECHO Job failed! Error Code: %ERRORLEVEL%. Refer log file for further details.

:End
@ECHO %DATE% %TIME%: CompUp end!


11 July 2009

Defining Social CRM

With the advent of the next edition of CRM @ Speed of Light near due and keeping in mind that the new edition is going to have a LOT of Social CRM, we have a solid definition of Social CRM from Paul Greenberg.

SCRM is a philosophy & a business strategy, supported by a technology platform, business rules, workflow, processes & social characteristics, designed to engage the customer in a collaborative conversation in order to provide mutually beneficial value in a trusted & transparent business environment. It’s the company’s response to the customer’s ownership of the conversation.

There is also a condensed discussion of what Social CRM is about and is definitely worth a look at. What interests me at this point are these quotes (quotes by Mr. Greenberg, comments are mine):

  • “Social CRM is not a replacement for CRM”: In my view SCRM would never replace conventional CRM. Of course it will add a better communication channel between the organization and customers. This facilitates a more effective listening to the customers , providing a better service proactively and maybe sell/up-sell/cross-sell products/services
  • “The customer controls the business ecosystem and the conversation, but not the business”: The organization itself carries on with its established way of doing business, what SCRM provides is an add-in (a powerful one at that) to effectively align business processes to customer needs and determine how to effectively manage business by mapping customer’s expectations with the organization’s goals
  • “We’ve moved from the transaction to the interaction with customers”: The customers do not talk and get recorded as a single “activity”. We need to capture the length & breadth of how the customer views the organization, what he is saying about the service/products and determine how we can turn him into a believer
  • “When you look at the SCRM applications out there - there are no actual SCRM suites, no matter what the claims of any company on either the CRM or social tools side”: One of the basic ideas to being customer friendly is to engage the customer on his turf. CRM suites will capture this information from multiple sources, help analyze and actionize the identified items. But I don’t believe this will discourage organizations from using the Social CRM tag. As of today any CRM suite which can provide a decent integration with Social media out there may classify itself as enabling Social CRM. But I would expect the product vendors to delve deeper into the interfacing capabilities to retrieve, understand and act on the “word on street”.
Read more at ZDNet Blogs

16 June 2009

Siebel: Integrating Twitter

If you have not yet seen the demo of Twitter integration with Siebel on Dipock's blog, it is probably a good time to see it. Available there is a demo video that lists out three basic steps to integrate Twitter search in Siebel. For those of you who have a slower internet connection, here are the steps:
  1. Create a calculated field that uses a iFrame to retrieve Twitter search results based on Account name, URL will be something like "http://search.twitter.com/search?q=siebel crm"
  2. Expose the field on a separate applet and display the results in a view

Simple enough to allow the user to search for the account and what not, but how will we make this "actionable"? There comes the use of Siebel's powerful Virtual Business Components (VBC) functionality. Twitter exposes APIs that can fetch search results in atom format. A simple transformation followed by conversion to property set and voila, we have results in a format fit enough to be displayed in any view that you like. The steps you ask?
  1. Create VBC and applet based on VBC
  2. Write supporting script/business service to make sense of the search results, to retrieve Twitter search results using API at http://search.twitter.com/search.atom
  3. Transform and map the values to VBC fields
Not exactly as simple as the previous idea, but the biggest advantage is that you can use this data for subsequent actions - may it be creating a follow-up activity for the Tweet, creating a Service Request to address the complaint raised or just to track the conversation thread for the particular user/tweet.

Although these steps are listed with Twitter in focus, the same will be applicable for any Social media which expose APIs in atom/xml format. The process itself is not entirely different from your regular interface to an enterprise app, but yes, the treatment of how exactly you leverage the Social media effectively certainly is.

08 June 2009

CRM @ The Speed of Light - 4th Edition Excerpts

CRM @ The Speed of Light has been a successful, popular book for all things CRM. If you have not read that, consider doing it now. Or better still, wait for the next edition. Paul Greenberg, author & CRM Guru says it is rewritten from scratch. "Raw" excerpts for a couple of chapters on his blog.

New from Gartner: 5 Low-cost CRM Strategies

After all, this is a period of recession - organizations want to cut costs and will be increasingly cautious about investing in any new venture. So, Gartner’s five low-cost CRM strategies will probably be accepted with open arms. I have not read the complete report, but the main points are below (the detail itself is mine, pardon the intrusion)..

  1. Customer communities
    The inclusion is no surprise, engaging customers and building longer term relationships may not cost organizations much. At the low end of the spectrum, this may simply need people to manage the relationships in the social world. Of course this data should flow on to the CRM & Analytical systems for any intelligent deduction, but hey you cannot start everything at once! Setting up corporate accounts may not cost anything (for mostl of them, till date), but making sense out of this data and converting it into actionable items is worth considering for further investments.
  2. Analytics
    Data, you have everywhere but does it answer questions like “what is happening with my customers?”, “where am i doing good/going wrong?”. This is where Analytics is going to be crucial. With a few new things coming up, people may start using Analytics better to start leveraging the data.
  3. Segmentation
    I have to admit that this is a surprise for me; maybe I am not keeping up with the “trend”. Keeping track of the customer groups that deliver the highest value is an on-going process and better ways of segmentation will help organizations focus on what is important right now.
  4. Process redesign
    Streamlining business processes may not need much investment, but certainly would need people buy-in. Any or all out-of-sync processes that may need frequent oiling for a smooth run could be targeted for improvement.
  5. Organizational redesign
    For some reason I think this was just added as an after-thought, maybe it is just that 4 looks so incomplete :).. Scott Nelson, managing vice president at Gartner, who presented these strategies says organizations should use this time to move from being product-centric to being customer-centric.

Overall, this is a good framework to maintain a status-quo on significant investments in IT and at the same time take steps to improve customer experience. Nothing exceptionally new I am afraid, but what is left unsaid here is the roadmap to start achieving the objectives.

Read More on techtarget

Social Media in Action

Here’s one of the stories I came across recently that demonstrates the power of social media tools to really “listen” to the customer. In an impressive story of CRM in action, Gaylord resort chain gained a fan in Lauren McKay at CRM Magazine and will surely pickup other customers along the way.

At the end of the day, what did surprise me eventually was not that Gaylord used twitter. After all, a lot of folks including Dell, SAP, Pepsi, Oracle and a host of others are quite active on Twitter. The fact that Gaylord could make use of a isolated tweet sometime in the past and provide customer service based on that should classify as an achievement. In the above case, Gaylord listened to a single (but valuable) customer and was agile enough to leverage that information at a later time.

A large part of that service certainly comes from the people over at Gaylord, but I believe they are getting required support by IT. There may be some level of integration between Twitter and their customer management application, and it is a good example of what can be done to CRM applications. More than a few SaaS vendors have long made the integration part easy, but without building a business framework to realize value out of that exercise may leave the people disenchanted about the power of Social CRM.