Configuring Siebel Open UI > Customizing Siebel Open UI for Siebel Mobile Disconnected > Customizing Siebel Service for Siebel Mobile Disconnected Clients >

Allowing Users to Set the Activity Status


The example in this topic describes how to enable the activity status so that the user can update this status during the service call life cycle. For example, a field service representative can examine an Activity that is set to Dispatched, set this status to Acknowledged to acknowledge that this representative examined the activity, set the status to EnRoute, travel to the customer site, set it to Arrive, set it to In Progress while working on the service call, and then set it to Finish after finishing the service call. Siebel Open UI includes the following status values:

  • Dispatched
  • Acknowledged
  • Declined
  • En Route
  • Arrive
  • In Progress
  • Hold
  • Resume
  • Finish

Siebel Open UI enables and disables the status depending on the current value of the status. For example, if the representative sets the status to Acknowledged, then Siebel Open UI allows the user to choose the EnRoute status and disables all other values.

The work you do to allow a user to set the status is similar to the work you do to allow a user to commit a Part Tracker record. For example, registering the service, and so on. For more information, see Allowing Users to Commit Part Tracker Records.

To allow users to set the activity status

  1. In Windows Explorer, navigate to the following folder:

    INSTALL_DIR\applicationcontainer\webapps\siebel\scripts\siebel\offline

    For more information about the language_code, see Languages That Siebel Open UI Supports.

  2. Use a JavaScript editor to open the serviceactstat.js file.
  3. Locate the following code:

    serviceactstat.prototype.InvokeSetActStatus=function(psInpArgs,svcMthdName){

    var psOutArgs=SiebelApp.S_App.NewPropertySet();

    if(!psInpArgs){

    return (false);

    }

    if(psInpArgs.propArray.MethodName=="AcceptStatus")

    {psOutArgs=this.SetActivityStatus("Acknowledged");

    }

    else if(psInpArgs.propArray.MethodName=="Start"||psInpArgs.propArray.

    MethodName=="ArrivedStatus"){psOutArgs=this.SetActivityStatus("In

    Progress","ArrivedStatus");

    }

    else if(psInpArgs.propArray.MethodName=="DeclineStatus"){

    psOutArgs=this.SetActivityStatus("Declined");

    }

    else if(psInpArgs.propArray.MethodName=="EnrouteStatus"){

    psOutArgs=this.SetActivityStatus("In Progress");

    }

    else if(psInpArgs.propArray.MethodName=="SuspendStatus"){

    psOutArgs=this.SetActivityStatus("On Hold");

    }

    else if(psInpArgs.propArray.MethodName=="ResumeStatus"){

    psOutArgs=this.SetActivityStatus("In Progress");

    }

    else if(psInpArgs.propArray.MethodName=="End"||psInpArgs.propArray.

    MethodName=="FinishedStatus"){

    psOutArgs = this.SetActivityStatus("Done","FinishedStatus");

    }

  4. Add the following code immediately after the code you located in Step 3:

    serviceactstat.prototype.SetActivityStatus=function (pStatus,pDateMethodInv){

    var currRetValue={err:false}, retObj;

    SiebelJS.Log('Service Method SetActivityStatus...');

    var strstatvalue;

    var pickName;

    var pickListDef;

    var pModel;

    var pBusComp;

    pModel= SiebelApp.S_App.GetModel();

    var pBusObj = pModel.GetBusObject("boName");

    pBusComp = pBusObj.GetBusComp("bcName");

    pickName=SiebelApp.S_App.GetActiveView().GetActiveApplet().GetControl("Status").GetPickApplet();

    pickListDef=pickListDef = pBusComp.GetPickListInfo(pickName);

    pModel=SiebelApp.S_App.Model;

    strstatvalue=pModel.GetLovNameVal("Acknowledged", pickListDef.LOVType);

    currRetValue=pBusComp.ActivateField("Status");

    currRetValue=pBusComp.SetFieldValue("Status",strstatvalue,true);

    currRetValue=pBusComp.ActivateField("Status");

    currRetValue=pBusComp.SetFieldValue("Status",strstatvalue,true);

    if(pDateMethodInv!="")//Todo - Refine this condition for uninitialized/defined or remove this condition

    {

    var now=new Date();

    if(pDateMethodInv == "ArrivedStatus") {

    currRetValue=pBusComp.SetFieldValue("Started",now,true);

    currRetValue=pBusComp.SetFieldValue("Done","",true);

    }

    else if(pDateMethodInv=="FinishedStatus") {

    currRetValue=pBusComp.SetFieldValue("Done",now,true);

    currRetValue=pBusComp.SetFieldValue("Percent Complete","100%",true);

    }

    }

    currRetValue=pBusComp.WriteRecord();

    return currRetValue;

    };

    For information about the methods that this code uses, see the following:

  5. Test your modifications:
    1. Log in to the disconnected client.
    2. Update the status of an activity.

      Make sure Siebel Open UI displays the correct status activity. For example, if you set the status to Acknowledged, then make sure Siebel Open UI allows you to choose the EnRoute status and disables all other values.

Configuring Siebel Open UI Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.