tnServices
The number of scheduled services required
tddate
The date from which to retrieve services
tcWO_Type
The work order type of workorders which denote booked services
tcLevel
The level at which the above work order types must be at
tcCancelWO_Type
The work order type which represents cancelled work orders for scheduled
services. Leave blank if you don't cancel jobs with work orders
tcCursor
The name of the internal cursor to store the results
The structure of the list returned is as follows;
ChargeID c(10) - Charge ID of scheduled Charge
RouteID c(10) - Route ID of scheduled Charge
Work_Order c(10) - Work Order number if a work Order(empty if not)
route_num c(5) - Route number assigned
cycle c(3) - Cycle of route
date Date - Date of service
o.GetNextNScheduledServicesbyContract("OC234234",12,{01/07/2003},"S","2","CAN","scheduled")
The above would;
1. Retrieve the next 12 dates for the run assigned to the charge in contract "OC234234"
as of the 01/07/2003
2. Also inlcuded in this list would be the dates of any work orders of type "EDP" and level 2
which contain the charge held in the contract "OC234234"
3. Removed from this list would be any scheduled services which have been cancelled by creating
a work order of type "CAN" on the same date and having the same contract number assigned
4. Place this list in the internal cursor "Scheduled"
5. Place the list in the collection o.oRows
To access the results you can either user the createresultxml function or access the data
directly. For instance if you wanted to cancel any services for tomorrow you could
use something like the following
ldCancelDate = Date() + 1
For each orow in o.Rows
ldDate = orow.date
lcworkorder = orow.Work_Order
If ldDate = ldCancelDate
DO case
Case not Empty(lcworkorder)
this.cancelworkorderservice(lcworkorder, "Cancelled by IVR", "Do not perform service")
Otherwise
this.cancelscheduledservice("OC234234" , lddate, "S", "1", "Cancelled by IVR", "Do not perform service")
EndCase
EndIf
EndFor