A user sent me a requirement today which I found interesting (to be honest a bit easy which I could complete and test quickly), but this is a common requirement and can be daunting for a Siebel newbie. So thought of posting the solution for everybody.
When a Service Request is created the default status is “Pending”. Now the user starts work on it and finally changes the SR status to “Closed” when done. We need to display the time taken to complete the Service Request (from “Pending” to “Closed”) in a field called “Handle Time”.
For the solution I have assumed certain things which are
1. We need to display “Handle Time” in minutes.
2. Changing the status to closed is the last thing that user does on Service Request.
1. Create a calculated field with expression:
IIf([Status] = ‘Closed’, ([Updated] – [Created]) * 24 * 60, ”)
2. Set the “Immediate Post Changes” Flag to true for Handle Time
3. Expose this field on the Applet and you are done.
Note: In case if there is some processing that is done after the status is closed then this will not give you accurate time as the updated date will change accordingly.
For this case you can follow the below given approach.
- Create a base field “Close Time” to store the time when SR is closed
- Create a On Field Update Set user property to update “Close Time” with following experssion
- “Status”, “Close Time”, “IIF([Status] = ‘Closed’, Today (), ‘’)”
- In the Handle Time field change your expression to the following
- IIf([Status] = ‘Closed’, ([Close Time] – [Created]) * 24 * 60, ”)
Comments are welcome!!