Configuring Siebel Business Applications > Configuring the Customer Dashboard > Options to Update the Customer Dashboard >

Using Siebel Visual Basic or Siebel eScript to Update Information in the Customer Dashboard


You can use Siebel Visual Basic or Siebel eScript to update information in the Customer Dashboard or pull information from the Customer Dashboard. Because the Customer Dashboard is a business service, you must use the following command:

GetService("Persistent Customer dashboard")

You use the following commands to pull information from the dashboard:

  • GetCurrentContactId
  • GetDashboardFieldValue

Command to Get the Record Id of the Current Dashboard Record

This GetCurrentContactId command returns the record Id for the record that Siebel CRM currently displays in the Customer Dashboard. For example:

  • If the record is from the Contact business component, then GetCurrentContactId returns the ContactId
  • If the record is from the Account business component, then GetCurrentContactId returns the AccountId.

Do not define any input arguments.

Always define ContactId as the output argument. The Customer Dashboard uses the ContactId variable. In this situation, this variable includes the record ID of the business component whose data Siebel CRM currently displays in the Customer Dashboard.

Example of the GetCurrentContactId Command

The following code is an example of the GetCurrentContactId command:

bs.InvokeMethod("GetCurrentContactId",inpargs,outargs);

var fvalue = outargs.GetProperty("Contact Id");

// do something with the contact ID

Command to Get the Value of the Current Dashboard Field

The GetDashboardFieldValue command returns the current field value of the current record in the Customer Dashboard. The input argument is the name-value pair for the Customer Dashboard field. The output argument is Field Value.

Example of the GetDashboardFieldValue Command

The following code is an example of the GetDashboardFieldValue command:

inpargs.SetProperty("Field Name","Field 4");

bs.InvokeMethod("GetDashboardFieldValue",inpargs,outargs);

var fvalue = outargs.GetProperty("Field Value");

// do something with the field value

Update Dashboard Command

You use the Update Dashboard command to enter a new record in the Customer Dashboard. This example uses the following name-value pairs as input arguments:

  • Source Name: Base View
  • Buscomp Name: Contact
  • RowId: E301
Example of the Update Dashboard Command

The following code is an example of the Update Dashboard command:

inpargs.SetProperty("Source Name","Base View", "Buscomp Name", "Contact", "RowId", "E301");

bs.InvokeMethod("Update Dashboard",inpargs,outargs);

Examples of Using Customer Dashboard Commands with Script

The examples in this topic use Customer Dashboard commands to do the following:

  • Get the contact ID, Field 4, and Field Time of the current record in the Customer Dashboard.
  • Print values of the contact ID, Field 4, and Field Time to a file.
Example of Using Customer Dashboard Commands with Siebel eScript

The following example script is written in Siebel eScript. For more information, see Siebel eScript Language Reference:

function Script_Open ()
{
   var fn1=Clib.fopen("d:\\sabari5.txt", "wt");
   var bs = TheApplication().GetService("Persistent Customer dashboard");
   var inpargs= TheApplication().NewPropertySet();
   var outargs = TheApplication().NewPropertySet();

   bs.InvokeMethod("GetCurrentContactId",inpargs,outargs);
   var fvalue = outargs.GetProperty("Contact Id");
   Clib.fprintf (fn1, "The current id in the dashboard = %s \n",fvalue);

   inpargs.SetProperty("Field Name","Field 4");
   bs.InvokeMethod("GetDashboardFieldValue",inpargs,outargs);
   var fvalue = outargs.GetProperty("Field Value");
   Clib.fprintf (fn1, "The Account Name in the dashboard = %s \n",fvalue);

   inpargs.SetProperty("Field Name","Field Time");
   bs.InvokeMethod("GetDashboardFieldValue",inpargs,outargs);
   var fvalue = outargs.GetProperty("Field Value");
   Clib.fprintf (fn1, "The current time of the agent/customer in the dashboard =
   %s \n",fvalue);

   Clib.fclose(fn1);
return(ContinueOperation);
}

Example of Using Customer Dashboard Commands with Siebel Visual Basic

The following example script is written in Siebel Visual Basic. For more information, see Siebel VB Language Reference:

Sub Script_Open

     Dim bs as Service
     Dim inpargs as PropertySet
     Dim outargs as PropertySet
     Dim fvalue as String

Open "d:\sabari.txt" for Output as #1
Set bs = TheApplication().GetService("Persistent Customer dashboard")
     Set inpargs = TheApplication.NewPropertySet
     Set outargs = TheApplication.NewPropertySet

     bs.InvokeMethod "GetCurrentContactId",inpargs,outargs
     fvalue = outargs.GetProperty("Contact Id")
     Write #1, "The current id in the dashboard = " & fvalue

     Inpargs.SetProperty "Field Name","Field 4"
     bs.InvokeMethod "GetDashboardFieldValue",inpargs,outargs
     fvalue = outargs.GetProperty("Field Value")
     Write #1," The Account Name in the dashboard = "& fvalue
     Close #1

End Sub

Configuring Siebel Business Applications Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.