pse.TeamScheduleTemplateServiceglobal with sharing class TeamScheduleTemplateService This class contains a Team Schedule Template API implementation, including sub-classes for team schedule template creation requests. There are sub-classes for team schedule template creation requests. MethodscreateTeamScheduleTemplateglobal Set<Id> createTeamScheduleTemplate(Id teamId, List<pse.TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest> createTeamScheduleTemplateRequest) This method creates a team schedule template using details provided from the CreateTeamScheduleTemplateRequest list. Input Parameters
Exceptions Thrown
Return ValueThis service returns the ids of the newly created team schedule templates. Sample Code//Note: This sample code is for demonstration purposes only. It is not intended for //use in a production environment, is not guaranteed against defects or errors, and //is in no way optimized or streamlined. // This is sample code for creating a team schedule template using TeamScheduleTemplateService API. static void testCreateTeamScheduleTemplateRequest() { /** * The CreateTeamScheduleTemplateRequest class extends the TeamScheduleTemplateRequest so that you can create an instance of CreateTeamScheduleTemplateRequest. * Here we are creating two team schedule templates for team1. */ Id teamId = team1.id; Team_Schedule_Slot_Type__c slotType = new Team_Schedule_Slot_Type__c( Type__c = 'Weekday, Non-blocking' ); insert slotType; // Creates a list of TeamScheduleTemplateSlotDetail objects. List<TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail> slots = new List<TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail>(); // Creates an instance of the TeamScheduleTemplateSlotDetail class with a default constructor and required properties. TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail s1 = new TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail('s1', '4:00am', '4:30am', 4.25, 6, slotType.Id); TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail s2 = new TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail('s2', '5:00am', '5:30am', 4, 6, slotType.Id); slots.add(s1); slots.add(s2); // Creates an instance of the CreateTeamScheduleTemplateRequest class with a default constructor. TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest createSchTempReq1 = new TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest(teamId, 'Template1', slots); TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest createSchTempReq2 = new TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest(teamId, 'Template2', slots); // Creates a list of CreateTeamScheduleTemplateRequest objects. list<TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest> listSt = new list<TeamScheduleTemplateService.CreateTeamScheduleTemplateRequest>(); listSt.add(createSchTempReq1); listSt.add(createSchTempReq2); // Creates an instance of the TeamScheduleTemplateService class. TeamScheduleTemplateService objTeamSchTempService = new TeamScheduleTemplateService(); // Calls the createTeamScheduleTemplate API method. Set<Id> result = objTeamSchTempService.createTeamScheduleTemplate(teamId, listSt); System.assertEquals(2, result.size()); } pse.TeamScheduleTemplateService.TeamScheduleTemplateRequestglobal abstract class TeamScheduleTemplateRequest The request structure for the TeamScheduleTemplateRequest class. Properties
pse.TeamScheduleTemplateService.CreateTeamScheduleTemplateRequestglobal inherited sharing class CreateTeamScheduleTemplateRequest extends TeamScheduleTemplateRequest The request structure for creating a team schedule template. This class extends pse.TeamScheduleTemplateService.TeamScheduleTemplateRequest Properties
MethodsCreateTeamScheduleTemplateRequestglobal CreateTeamScheduleTemplateRequest(Id teamId, String templateName, List<pse.TeamScheduleTemplateService.TeamScheduleTemplateSlotDetail> slots) A default constructor CreateTeamScheduleTemplateRequest class with the minimum required properties. Input Parameters
pse.TeamScheduleTemplateService.TeamScheduleTemplateSlotDetailglobal inherited sharing class TeamScheduleTemplateSlotDetail The structure for the Custom Exception class, used to throw errors. Properties
MethodsTeamScheduleTemplateSlotDetailglobal TeamScheduleTemplateSlotDetail(string slotName, string startTime, string endTime, decimal hours, Integer capacity, Id slotTypeId) A default constructor with the minimum required properties. Input Parameters
|