ScheduleResult Class

Represents the result of scheduling a service appointment that is returned by the ScheduleService.schedule method.

Namespace 

FSL

Example 

This example shows the contents of a returned ScheduledResult object.

1[
2	BreakObject=null, 
3	Grade=100.000000000000000000000000000000, 
4	LongOperationId=null, 
5	PartialResults=(), 
6	Resource=ServiceResource:
7	{Id=0Hn4E0000004bucSAA, Name=Crew A, IsActive=true, IsCapacityBased=false, ResourceType=C, ​ServiceCrewId=1cr4E0000004CM7QAM, Contractor_Priority__c=2}, 
8	Service=ServiceAppointment:
9	{Id=08p4E000000LeMiQAK, Status=None, FSL__Same_Day__c=false, FSL__Same_Resource__c=false, ​AppointmentNumber=SA-6214, DueDate=2018-09-20 17:07:00, EarliestStartTime=2018-09-17 17:07:00, Duration=1.5, DurationType=Hours, Latitude=37.793872000000000, ​Longitude=-122.394865000000000, FSL__InternalSLRGeolocation__Latitude__s=37.793834, FSL__InternalSLRGeolocation__Longitude__s=-122.395123, ServiceTerritoryId=0Hh4E0000000OtPSAU, ​FSL__Schedule_over_lower_priority_appointment__c=false, FSL__Use_Async_Logic__c=false, FSL__IsMultiDay__c=false, ParentRecordId=0WO4E000000Vl6rWAC, FSL__Emergency__c=false, ​SchedStartTime=2018-09-17 17:13:00, SchedEndTime=2018-09-17 18:43:00, FSL__Schedule_Mode__c=Automatic, FSL__Scheduling_Policy_Used__c=a0N4E0000031HPVUA2}
10	]

ScheduleResult Properties 

ScheduleResult contains the following properties.

breakObject 

Not currently in use.

Signature 

public ResourceAbsence breakObject {get; set;}

Property Value 

Type: ResourceAbsence

grade 

The grade of the slot in which the service appointment was scheduled.

Signature 

public Decimal grade {get; set;}

Property Value 

Type: Decimal

longOperationId 

This field only applies to scheduling service appointments that don’t use Enhanced Scheduling and Optimization (ESO). Populated when scheduling a group of two dependent service appointments, also known as complex work. An asynchronous call is made to schedule both service appointments in the dependency group. This property contains the FSL__FSL_Operation__c ID.

Signature 

public Id longOperationId {get; set;}

Property Value 

Type: Id

Usage 

To learn more about scheduling dependencies and complex work, see Create Scheduling Dependencies Between Service Appointments.

To learn about Enhanced Scheduling and Optimization, see Get Ready for Scheduling and Optimization.

partialResults 

Relevant only when Limit Apex Operations is enabled in the Field Service Admin app. If the processing time of the ScheduleService is about to exceed the maximum CPU limits, partialResultsreturns the results that were already calculated and halts the process. This list contains the details of the partial, processed results.

Signature 

public List<FSL.PartialResultsInfo> partialResults {get; set;}

Property Value 

Type: List<FSL.PartialResultsInfo>

serviceResource 

The service resource assigned to the service appointment.

Signature 

public ServiceResource serviceResource {get; set;}

Property Value 

Type: ServiceResource

serviceAppointment 

The scheduled service appointment.

Signature 

public ServiceAppointment serviceAppointment {get; set;}

Property Value 

Type: ServiceAppointment