Thursday, Jan. 18, 2018

Creating Client Side Business Service

Written By:


March 14, 2012


Posted In:

Client side business service is created through UI and is not compiled into srf. It is stored in client database.

Steps to create Client Side BS:

1. Gather BO and BC data for the records on which operations are to be performed. For e.g. below shown is a business service to delete a row.

In this scenario, we are going to delete Cindy Allen row from coverage team.

So gather this info from ‘About View’:

BO: Account
BC: FINS CI Position
Row id: 1-GBF9

2. Navigate to the Administration-Business Service->Details and create a new business service.

3. Go to Administration-Business Service->Methods and create the BS methods and their input and output parameters. Now parameters vary on the type of operations you want to perform, in this particular case you need to get the row id for the record(s) to be deleted.

4. Now go to Administration-Business Service->Scripts and write the code to perform the operations required.

Script Explained:

function Service_PreInvokeMethod(MethodName, Inputs, Outputs)
if (MethodName == ‘Delrec’)
//Declare variables to be used—

var boBusObject : BusObject;
var bcBusComp : BusComp;
var rows : String ;
var i : Number;

//Initiate the variables
i = 0;
boBusObject = TheApplication().GetBusObject(‘Account’);
bcBusComp = boBusObject.GetBusComp(‘FINS CI Position’);
rows = Inputs.GetProperty(“rows”);   //Get input parameters through GetProperty() function


with (bcBusComp)                          //so that you don’t have to use BC name with every method
ClearToQuery();                             // Clear any previously fired query results from dataset

SetViewMode(AllView);             //Set the visibility type. ‘All View’ corresponds to data across all orgs

InvokeMethod(“SetAdminMode”, “TRUE”);     //To set query running privileges on database.

ActivateField(“Id”);                       // Activate the fields to be used in script

SetSearchSpec(“Id”,rows);        // To query the records based on row ids given as input parameter

var visRecord = FirstRecord();   // Set resulting dataset pointer to first record
while (visRecord)                           // loop until data exists in resultset
DeleteRecord();       //Method for deleting the row
visRecord = FirstRecord();            // Reset the pointer to point //at first record in resultset left
Outputs.SetProperty(“RecordCount”, i);                             //To check the number of rows processed

// Empty the variable resources
bcBusComp = null;
boBusObject = null;

Also See :

Test / Run Client Side Business Service

Share This Article

About Author


Siebel Technical Consultant

Comments are closed.

Leave A Reply