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
- In Windows Explorer, navigate to the following folder:
INSTALL_DIR\eappweb\PUBLIC\language_code\build_number\scripts\siebel\offline
For more information about the language_code, see Languages That Siebel Open UI Supports.
- Use a JavaScript editor to open the serviceactstat.js file.
- 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"); }
- Add the following code immediately after the code you located in Step 3:
serviceactstat.prototype.SetActivityStatus=function (pStatus,pDateMethodInv){ 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"); SiebelApp.S_App.GetActiveView().GetActiveApplet().GetControl("Status").GetPickAppl et(); $.callback(this,function(retObj){ pickName = retObj.retVal; $.callback(this,function(retObj){ pickListDef=retObj.retVal; pModel=SiebelApp.S_App.Model; pModel.GetLovNameVal("Acknowledged", pickListDef.LOVType); $.callback(this,function(retObj){ strstatvalue=retObj.retVal; pBusComp.ActivateField("Status"); $.callback(this,function(retobj){ pBusComp.SetFieldValue("Status",strstatvalue,true); $.callback(this,function(retobj){ }); }); }); }); }); pBusComp.ActivateField("Status"); $.callback(this,function(retobj){ pBusComp.SetFieldValue("Status",strstatvalue,true); $.callback(this,function(retobj){ }); }); if(pDateMethodInv!="")//Todo - Refine this condition for uninitialized/defined or remove this condition { var now=new Date(); if(pDateMethodInv == "ArrivedStatus") { pBusComp.SetFieldValue("Started",now,true); $.callback(this,function(retObj){ pBusComp.SetFieldValue("Done","",true); $.callback(this,function(retObj){ }); }); } else if(pDateMethodInv=="FinishedStatus") { pBusComp.SetFieldValue("Done",now,true); $.callback(this,function(retObj){ pBusComp.SetFieldValue("Percent Complete","100%",true); $.callback(this,function(retObj){ }); }); } } pBusComp.WriteRecord(); };
For information about the methods that this code uses, see the following:
- Test your modifications:
- Log in to the disconnected client.
- 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.
|