ScheduleJobsApi Class

Represents configurations to the Territory tab that is available for all scheduled jobs that are categorized under Enhanced Optimization.

FSL

This API uses two methods, getJob and setTerritory. getJob passes a job to setTerritory, and setTerritory applies a territoryID and groupPolicyID to that job via GroupData.

ScheduleJobsApi includes the following static methods.

Passes a scheduled job to thesetTerritory method, which modifies the territories.

global static ScheduleJobsApi getJob(String jobName)

jobName

Type: String

Required. The name of the job to update for service territory. The job name is case-sensitive.

Type: ScheduleJobsApi(validateJobId(jobId))

This method passes a job to setTerritory, which updates the Territory tab. See setTerritory for sample code.

Sets territories for a job returned by getJob and performs various validation checks.

public void setTerritory(List<GroupData> groupList)

groupList

Type: List<GroupData>

Required. A list of GroupData objects representing the territories and group policies to be associated with the job.

Type: Void

This method configures the Territory tab based on optimized territory and scheduling policy for a scheduled job. Here are two examples of code that configures the territory tab for a scheduled job.