GradeSlotsService クラス
名前空間
使用方法
GradeSlotsService のコンストラクター
GradeSlotsService のコンストラクターは次のとおりです。
GradeSlotsService のメソッド
GradeSlotsService には、次の静的メソッドが含まれます。
getGradedMatrix(i_ResultsInUserTimeZone)
署名
public FSL.AdvancedGapMatrix getGradedMatrix(Boolean i_ResultsInUserTimeZone)
パラメーター
- i_ResultsInUserTimeZone
- 型: Boolean
-
true の場合、すべての日時がユーザーのタイムゾーンで返されます。false の場合、すべての日時が UTC で返されます。
戻り値
使用方法
拡張されたスケジュール設定および最適化 (ESO) が有効な場合、このメソッドは同期して実行されます。ESO が有効ではない場合、このメソッドのコールでは、一度に 1 つのサービス予定しか使用できず、非同期的に実行されます。この非同期メソッドが返す結果を調べるために、ストリーミング API を使用して、Field Service 管理パッケージのチャネルである MstCompletedChannel に登録できます。
例
この例は、サービスリソース ID、開始時刻と終了時刻、各時間枠の評価を抽出するために FSL.AdvancedGapMatrix の結果を解析する方法を示しています。
1// FSL.GradeSlotsService class
2// The getGradedMatrix method returns a matrix of resource id's AND graded time slots
3
4Id serviceAppointmentId = '08p1N000000qN4sQAE';
5Id schedulingPolicyId=[SELECT Id FROM FSL__Scheduling_Policy__c WHERE Name='Customer First' LIMIT 1].Id;
6
7// GENERATE the graded time slots for the service appointment
8FSL.GradeSlotsService mySlotService = new FSL.GradeSlotsService(schedulingPolicyId,serviceAppointmentId);
9
10// STORE the matrix of service resource id's and graded time slots
11FSL.AdvancedGapMatrix myResultMatrix = mySlotService.getGradedMatrix(true);
12
13Map<Id,FSL.ResourceScheduleData> mySRGradedTimeSlotMap = myResultMatrix.ResourceIDToScheduleData;
14for (Id thisresourceid : mySRGradedTimeSlotMap.keySet()){
15 for (FSL.SchedulingOption thisso : mySRGradedTimeSlotMap.get(thisresourceid).SchedulingOptions ) {
16 system.debug('***** Resource Id' + thisresourceid);
17 system.debug('***** Start - ' + thisso.Interval.Start);
18 system.debug('***** Finish - ' + thisso.Interval.Finish);
19 system.debug('****** Grade - ' + thisso.Grade);
20 }
21}