Siebel SmartScript Administration Guide > Extending Scripts with Siebel VB and Siebel eScript >

Invoking Siebel Assignment Manager


You can invoke Siebel Assignment Manager from SmartScripts using Siebel eScript or Siebel VB. How you invoke Assignment Manager depends on the mode in which Assignment Manager is operating. If Assignment Manager is executing in interactive mode, you require a user (for example, a service representative) to perform some action (for example, assign a record to an employee) to advance the script.

If Assignment Manager is executing in dynamic mode, you can invoke it from a SmartScript by triggering certain events. A user is not required to invoke the Assignment Manager from the SmartScript.

The following example procedure demonstrates how to invoke Assignment Manager executing in dynamic mode on a newly created service request record.

To invoke Assignment Manager

NOTE:  This procedure is an example of how you can invoke Assignment Manager from a SmartScript.

  1. Create assignment rules for the service request object.

    For more information about assignment rules configuration, see Siebel Assignment Manager Administration Guide.

  2. Create a SmartScript with values similar to those in the following table.
    Element
    Attribute
    Value

    Question1

    Name

    SRDescription

    Answer Type

    String

    Answer Control

    Default

    Save Business Object

    Service Request

    Save Business Component

    Service Request

    Save Field

    Description

    Translations

    English-American

    Question 2

    Name

    TestQuestion2

    Answer Type

    RDsr2

    Answer Control

    RDsr2

    Translations

    English-American

    Page

    Name

    TestPage1

    First Question

    SRDescription

    Translation

    English-American

    Label

    TestPage1

    Next Question

    TestQuestion2

    SmartScript

    Name

    SmartScript_AssignSR

    Type

    Pick any value (Other)

    Active

    Yes

    First Page

    TestPage1

    Translation

    English-American

    Label

    SmartScript Assign SR

  3. Navigate to Administration - SmartScripts screen > Scripts view > Programs subview.
  4. In the Programs list, select Script_Finish, and add the following code:

    NOTE:  When assigning an object, it must exist in order to match the assignment rules, criteria, and so on. To make sure that a newly created record exists in the database, users can run the following event:
    BusinessComponent.WriteRecord()
    before calling an Assignment Manager method in the SmartScript event.

    function Script_Finish()

    {

    var sFirstQuestion = StartQuestion();

    var SaveBC = sFirstQuestion.GetSaveBusComp();

    TheApplication().Trace(" \n the value of sFirstQuestion = "+sFirstQuestion);

    SaveBC.ActivateField("Area");

    SaveBC.SetFieldValue("Area", "Upgrade");

    //*****************

    var myid = SaveBC.GetFieldValue("Id");

    SaveBC.WriteRecord();

    var bsAmgr = TheApplication().GetService("Synchronous

    Assignment Manager Requests");

    var psInput = TheApplication().NewPropertySet();

    var psOutput= TheApplication().NewPropertySet();

    psInput.SetProperty("AsgnObjName","Service Request");

    //Assignment Object Name

    psInput.SetProperty("ObjRowId", myid); //Object Row ID

    bsAmgr.InvokeMethod("Assign", psInput, psOutput);

    //*****************

    }

Siebel SmartScript Administration Guide Copyright © 2006, Oracle. All rights reserved.