Search This Blog

May 26, 2011

Siebel Workflows


Siebel Automation


Siebel Configuration


Siebel EIM


Siebel eScript

*************************************
     Server Scrpit UI Context
*************************************
----------------------------------------------------------------------------------------------------------------------
-- validate Account Name (BusComp_PreWriteRecord) on Account BC
    var min = 5;  
    var max = 12;  
    var len;  
    var n = 0;  
    var lname = this.GetFieldValue("Name");
    var flen = lname.length;  
  
    if(flen < min)  
    {          
        TheApplication().RaiseErrorText("Account name should be more than 4 characters");  
    }      
  
    if(flen > max)  
    {
        TheApplication().RaiseErrorText("Account name should not have more than 12 characters");  
    }  

    var rStrcspn = Clib.strcspn(lname,"1234567890");
  
    if(rStrcspn < flen)  
    {
        TheApplication().RaiseErrorText("Account name should not any number");
    }

- Right Click on the Account Business Component and Compile It.
---------------------------------------------------------------------------------------------------------------------
-- Set the JOb Field Value to Employee Whenever any New Record is Create on Contact BC.
1 - Select the Contact Business Component and Lock the it.
2 - Right and Select Edit Server Script Option.
3 - Select Function -  (BusComp_SetFieldValue (FieldName)) .
4 - Write the following script.
-- set the job field value.
    var defJob = "Employee";  
    this.SetFieldValue("Job Title",defJob);

5- Right Click on the Contact Business Component and Compile It.
6- Open Siebel web client and go to Conact create a new record to test it.
---------------------------------------------------------------------------------------------------------------------
-- Do not allow to delete the account if the status is Active.
1 - Select the Account Business Component and Lock the it.
2 - Right and Select Edit Server Script Option.
3 - Select Function -  BusComp_PreDeleteRecord
4 - Write the following script.

function BusComp_PreDeleteRecord ()
{
    var status = this.GetFieldValue("Account Status")
    if(status == "Active")
    {
        TheApplication().RaiseErrorText("You can not delete this account as its a Active account.");                  
        return (CancelOperation);
    }
    else
    {
        return (ContinueOperation);
    }
}

5- Right Click on the Account Business Component and Compile It.
---------------------------------------------------------------------------------------------------------------------
-- Do not allow to change the account status if current volume is greater than 0.
1 - Select the Account Business Component and Lock the it.
2 - Right and Select Edit Server Script Option.
3 - Select Function -  BusComp_PreSetFieldValue
4 - Write the following script.

function BusComp_PreSetFieldValue (fieldName, value)
{

   if (fieldName == "Account Status")
   {
      var cVolume = this.GetFieldValue("Current Volume");

      if ((value == "Inactive") && (cVolume > 0))
      {
         TheApplication().RaiseErrorText("Unable to inactivate an account that has a current volume greater than 0");
         return ("CancelOperation");
      }
      else
         return ("ContinueOperation");
   }
   else
      return ("ContinueOperation");
}
---------------------------------------------------------------------------------------------------
-- Write Script to Call Server Script on User Define Button.
Server Script with Applet Button :

1 - Check the current volumn field value on the button click using the server script.

1) Goto Applet Query for Account Entry Applet
2) Right Click and Edit Web Layout and Drag a MiniButton from Palette window to Applet.
3) Right Click the Button and goto Property window.
    -- Change the following peroperties.
    -- Caption-String Overriden : Check Volume
    -- Runtime  = TRUE
    -- MethodName = CheckVol

4) Save the changes and close the web layout.
5) Now Right the method to enable the button on applet.
6) Right click on Account Entry Applet and click on Edit Server Script.
7) Goto WebApplet_CanPreInvoke Method and write the following script.

    // enable the button on applet
    if(MethodName == "CheckVol")
    {
        CanInvoke="TRUE";
        return (CancelOperation);
    }
    return (ContinueOperation);

8) Now we will be writting a function to call on the button click.
9) Query for the Business Component Account and Right Click select Edit Server Script.
10) Goto BusComp_PreInvokeMethod method and write the following script.

function BusComp_PreInvokeMethod (MethodName)
{
    var vol = this.GetFieldValue("Current Volume");

    if( vol > 0 )
    {
        TheApplication().RaiseErrorText("Volumn exist for this account. Volumn = " + vol);
        return (CancelOperation);
    }
    else
    {
        TheApplication().RaiseErrorText("Volumn does not exist for this account.");
        return (ContinueOperation);
    }
}
----------------------------------------------------------------------------------------------------------
*************************************
    Server Scrpit Non UI Context
*************************************

-- Do not allow to delete the account if an opportunity is exist for the account.
1 - Select the Account Business Component and Lock the it.
2 - Right and Select Edit Server Script Option.
3 - Select Function - BusComp_PreDeleteRecord.
4 - Write the following script.

TheApplication().TraceOn("c:\temp\opp_trace.txt","Allocation","All");
var returnCode = ContinueOperation;

try
{
    //get the BO and BC first for the Opporunity.
    var boOpty;
    var bcOpty;
    var rowID;
    // get the rowid
    rowID = this.GetFieldValue("Id");


    // create the business object using GetBusObject method.
    boOpty = TheApplication().GetBusObject("Opporunity");
    bcOpty = boOpty.GetBusComp("Opporunity");

    // trace the operation
    TheApplication().Trace("Preparing Query");
  
    with(bcOpty)
    {
        SetViewMode(ViewAll);
        ActivateField("Account Id"); // must activate the field before the cleartoquery method.
        ClearToQuery(); // clears the current query.
        SetSearchExpr("[Account Id]= '"+rowID+"'");
        ExecuteQuery(ForwardOnly);
    }
    TheApplication().Trace("Query Executed.");
  
    if(bcOpty.FirstRecord())
    {
        returnCode = CancelOperation;
        TheApplication().RaiseErrorText("Opp is exist for this Account. It can not be deleted.");
    }
    else
    {
        returncode = ContinueOperation;
    }
}
catch(e)
{
    throw(e); //display error message to user
}
finally
{
    delete bcOpty;
    delete boOpty;
    TheApplication().TraceOff();
}
return (returncode);
------------------------------------------------------------------------------------------------------------
*************************************
            Browser Scrpit
*************************************

** Display the confirmation of the changing the account status from any other to active status.
1 - Select Applet in the Object List Expolrer.
2 - Select Account List Applet.
3 - Right Click on the Opportunity List Applet.
4 - select Edit Browser Scritp.
5 - Select Applet_ChangeRecord.
6 - Write the following script.
  
function Applet_ChangeFieldValue (field, value)
{
    //var status = this.FindControl("Account Status");
    if(field == "Account Status")
    {
        if(value == "Active")
        {
            var ans = confirm("are you sure you wnat to change status of this account");
            if(ans == true)
              return (ContinueOperation);
            else
              return (CancelOperation);             
        }
    }
}
7 - set the compile direcotry path using View - Option - Scripting
   - browswer script compilation folder : D:\siebel81\Client\PUBLIC\enu
----------------------------------------------------------------------------------------------------------------
Ex2 - Broswer Script
** Make the controls read only on the applet if the Service Request status is Cancelled.
1 - Select Applet in the Object List Expolrer.
2 - Select Service Request Detail Applet.
3 - Right Click on the Service Request Detail Applet.
4 - select Edit Browser Scritp.
5 - Select Applet_ChangeFieldValue(field,value)
6 - Write the following script.

if(field == "Status")
{      
    if(value=="Cancelled")  
    {      
        var tmp = this.FindControl("CommitTime");                                          
        tmp.SetProperty("ReadOnly",true);
        tmp = this.FindControl("ContactLastName");
        tmp.SetProperty("ReadOnly",true);
        tmp = this.FindControl("Account");                                              
        tmp.SetProperty("ReadOnly",true);              
        tmp = this.FindControl("Product");                                              
        tmp.SetProperty("ReadOnly",true);
        tmp = this.FindControl("Description");                                              
        tmp.SetProperty("ReadOnly",true);
        tmp = this.FindControl("Abstract");
        tmp.SetProperty("ReadOnly",true);      
    }
    else
    {
        var tmp = this.FindControl("CommitTime");
        tmp.SetProperty("ReadOnly",false);
        tmp = this.FindControl("ContactLastName");
        tmp.SetProperty("ReadOnly",false);
        tmp = this.FindControl("Account");
        tmp.SetProperty("ReadOnly",false);
        tmp = this.FindControl("Product");
        tmp.SetProperty("ReadOnly",false);
        tmp = this.FindControl("Description");
        tmp.SetProperty("ReadOnly",false);  
        tmp = this.FindControl("Abstract");                                              
        tmp.SetProperty("ReadOnly",false);      
    }
}
-----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-- Write a Browser script to Prompt a Message to user on the New Record creation ask to enter a value to continue. ( Value : Y || N )
1 - Select Applet Object Type in OE.
2 - Select Account List Applet in OBLE.
3 - Right Click on Account List Applet.
4 - Select Edit Browser Script.
5 - It will show the functions and three Modes of Applet.
  - Select function Applet_PreInvokeMethod and write the following Script.


function Applet_PreInvokeMethod (name, inputPropSet)
{
    if(name == "NewRecord")
    {
        var ans = prompt("Y to Create Record & N to Exit \n Enter a Value : ");  
        if(ans == "Y")
        {
            theApplication().SWEAlert("Please fill the records .....");
            return ("ContinueOperation");
        }
        if(ans == "N")
        {
            alert("Operation Cancelled.");
            return ("CancelOperation");
        }
    }
}
--------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
-- Write a Browser script to Prompt a Message to user on the New Record creation ask to enter a value to continue. ( Value : Y || N )
1 - Select Applet Object Type in OE.
2 - Select Account List Applet in OBLE.
3 - Right Click on Account List Applet.
4 - Select Edit Browser Script.
5 - It will show the functions and three Modes of Applet.
  - Select function Applet_PreInvokeMethod and write the following Script.


function Applet_PreInvokeMethod (name, inputPropSet)
{
    if(name == "NewRecord")
    {
        var ans = prompt("Y to Create Record & N to Exit \n Enter a Value : ");  
        if(ans == "Y")
        {
            theApplication().SWEAlert("Please fill the records .....");
            return ("ContinueOperation");
        }
        if(ans == "N")
        {
            alert("Operation Cancelled.");
            return ("CancelOperation");
        }
    }
}
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-- Create a Button on Applet and Export to Account Names to Excel using DOM Object.

1 - Select Applet Object Type in OE.
2 - Select Account List Applet in OBLE.
3 - Right Click on Account List Applet.
4 - Select Edit Web Layout
  - It will show the functions and three Modes of Applet.
5 - Select Edit List Mode and Add a button to Applet and Change the following properties ;
    - Caption String Override : Export 2 Excel
    - Method Invoke : Export
    - Runtime : TRUE.

6 - Save the applet and close the web layout.
7 - Select Account List Applet and Right Click Select Edit Server Script.
  - this step will enable the button on applet.
  Select function WebApplet_CanPreInvokeMethod and write the following Script.
    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
    {
        if(MethodName=="Export")
        {
            CanInvoke = "True";
            return (CancelOperation);
        }
        return (ContinueOperation);
}
- Save the script and Close the window.
8 - Select Applet Object Type in OE.
9 - Select Account List Applet in OBLE.
10 - Right Click on Account List Applet.
11 - Select Edit Browser Script.
12 - It will show the functions and three Modes of Applet.
  - Select function Applet_PreInvokeMethod and write the following Script.
Write the Following Script.

function BusComp_PreInvokeMethod (MethodName)
{
    var ExcelApp;

   if(MethodName == "Export")
   {

        this.ActivateField("Name");
         this.SetSearchSpec ("Name","*");
        this.ExecuteQuery(ForwardBackward);

        var count = this.CountRecords();

        ExcelApp = this.COMCreateObject("Excel.Application");
           ExcelApp.Visible = true;
           ExcelApp.WorkBooks.Add();
     
        this.FirstRecord();     

           for(var i=1;i<=count;i++)
           {
              ExcelApp.ActiveSheet.Cells(i,1).Value = this.GetFieldValue("Name");
               ExcelApp.ActiveSheet.Cells(i,2).Value = this.GetFieldValue("City");
               ExcelApp.ActiveSheet.Cells(i,3).Value = this.GetFieldValue("Account Status");
               this.NextRecord();
          }
      
        ExcelApp.Application.Quit();
           ExcelApp = null;
       }
    return (CancelOperation);


-------------------------------------------------------------------------------------------------------

What is Siebel CRM ?

1 - Siebel Customer Relationship Management (CRM)
Siebel CRM enables you to manage interaction with customers, partners, and employees.Its deployed as a single applicaion with broad functionality which support a multiple communicaton channels like :
- Web and email
- Call Center
- Field Service
Siebel CRM Application uses a single database to manage all the kind of OLTP work like Inserting a Records, Updating a Records, Deleting a Records mean while it also allows different users to access the same set of data.
- Example : The status of Opportunity is same across all the user like manager or the person who has created the opportunity or the opportunity is assigned to some person. This Application also ensure that changes to the data are made once and only once.
- Example : An address needs to be updated in only one place.

Siebel CRM Applications
Siebel CRM Applications are available tailored for different types of customer, partner, or employee interactions and channels
  • Horizontal applications)
  • Industry applications
  • Examples:
    • Horizontal applications
      1. Siebel Sales
      1. Siebel Call Center
      1. Siebel Partner Portal
      1. Siebel Remote
    • Industry applications
      1. Siebel Finance
      1. Siebel Consumer Goods
Types of Siebel Enterprise Applications
There are different types of applications are available in siebel crm for internal employees, company partners, company customers, 
  1. Employee Internal Application 
    1. Siebel Call Center
    2. Siebel Sales
  2. Customer and partner applications
    1. Siebel eSales
    2. Siebel Partner Portal
Siebel User Interface (UI) Modes
The Siebel Application User Interface is rendered in one of the two modes.

    - High Interactivity Mode
    - Standard Interactivity Mode

1) High Interactivity Mode
- This mode of UI is for the employee applications which supports high interactive users. It uses additional  code such as ActiveX controls to provide extra functionality like :
    1- User can drop and drop , change width, sorting on the columns
    2- Explorer like hierarchy views
    3- Menu bars and tool bars
    4- Saving the record as user move the cursor from the current record.

High Interactivity works only with Internet Explorer which supports the following version of IE.
    - 4.0
    - 5.0
    - 6.0
    1) Standard Interactivity Mode
    - This mode of UI is for the customers and employee applications which designed to be less browser dependent. It behave like a typical HTML based web application. It supports wide variety of browsers.

    Common Siebel Application Business Entities

    Siebel Application has some common business entities defined in the application which help to store the details related to the business activities or represent the information about your business. Business Entity is some thing of business interest in the real world.Business entity may Product, Account,Customers,Sales and so on.
    These Business Entities are referred as Business Components in Siebel Application.Some of the Business Component examples are :
    - Account, Contact , Opportunity, Service Request, Assets, Products and so on........
    1) Accounts : are businesses external to your company which represents a current potential client, a business partner, or a competitor.Accounts are associate with the Account Team in siebel Application.
    2) Contact: These are the people whom with you do business. These contact can me marked as public or personal contact they are also also associated with team.
    3) Opportunity : Its some thing potential revenue-generating events. It has the following characteristics :
                - A possible association with an account
                - A probability of completion
                - Will have close date.
    and so on..................

    What is CRM ?

    What does CRM mean to you?
    Customer relationship management (CRM) is a widely-implemented strategy for managing a company’s interactions with customers, clients and sales prospects. It involves using technology to organize, automate, and synchronize business processes—principally sales activities, but also those for marketing, customer service, and technical support. The overall goals are to find, attract, and win new clients, nurture and retain those the company already has, entice former clients back into the fold, and reduce the costs of marketing and client service.Customer relationship management describes a company-wide business strategy including customer-interface departments as well as other departments.


    Benefits of CRM  

    The use of a CRM system will confer several advantages to a company:

    • Quality and efficiency
    • Decrease in overall costs
    • Decision support
    • Enterprise agility
    • Customer Attention
    CRM Systems
    • Many IT systems have been developed to assist improving the efficiency of CRM, they have been grouped together and are now generically known as CRM software.
    • They range from contact databases to campaign management software.
    • They help get winning strategies for acquiring and retaining customers by leveraging the latest advanced technologies.
    • Refers to a software-based approach to handling customer relationships.
    • Information about customers and customer interactions can be entered, stored and accessed by employees in different company departments.
    • Used to implement CRM goals like- to improve services provided to customers, and to use customer contact information for targeted marketing
    • Software is often necessary to explore the full benefits of a CRM strategy. 
    Major Components
    • Sales functionality
      • Account management, Contact management, Opportunity management
    • Sales management functionality
      • Pipeline Analysis, Roll up and drill down reporting
    • Telemarketing/telesales functionality
      • call list assembly, auto dialing, scripting, order taking
    • Time management functionality
      • single user and group calendar/scheduling, email
    • Customer service and support functionality
      • Incident management, problem management, Warranty/contract management
    • Marketing functionality
      • Campaign management, market segmentation, lead management 
    • Executive information functionality
      • extensive and easy-to-use reporting
    • ERP integration functionality
      •  legacy systems, the web, third-party external information
    • Excellent data synchronization functionality
      • mobile synchronization
    • Field service support functionality
      • real time information transfer to field personnel via mobile technologies  
    Benefits 
    • Increased sales revenues  
    • Increased win rates Increased margins 
    • Improved customer satisfaction ratings 
    • Decreased general sales and marketing administrative costs 
    Eight Building blocks of CRM




    Siebel IP 2017 - Web Tool Development Steps

    Siebel IP 2017 Development and Deployment Steps : 1. Click on the Workspace Icon in Siebel Web Tools application. 2. Create a New work s...