pse.AddFromProjectTemplateServiceglobal with sharing class AddFromProjectTemplateService a service used to clone related records between projects. core fields of copied objects are also copied. This class contains deprecated items. MethodsaddFromTemplatesglobal static List<pse.AddFromProjectTemplateService.AddFromProjectResponse> addFromTemplates(List<pse.AddFromProjectTemplateService.AddFromProjectRequest> requests) This method clones related records between projects using the details specified. Multiple requests are executed asynchronously and sequentially, in the given order. Input Parameters
Return ValueThis service returns values in the AddFromProjectResponses list in response to the requests in the input list. 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. Id template1 = 'a2V0R000001km2BUAQ'; Id template2 = 'a2V0R000001khHXUAY'; Id destination = 'a2V0R000001km2LUAQ'; pse.AddFromProjectTemplateService.ProjectTaskRequest request1 = new pse.AddFromProjectTemplateService.ProjectTaskRequest(template1, destination); pse.AddFromProjectTemplateService.MilestoneRequest request2 = new pse.AddFromProjectTemplateService.MilestoneRequest(template2, destination); List<pse.AddFromProjectTemplateService.AddFromProjectRequest> requests = new List<pse.AddFromProjectTemplateService.AddFromProjectRequest>{ request1, request2 }; // Enqueue the Add From Template requests List<pse.AddFromProjectTemplateService.AddFromProjectResponse> responses = pse.AddFromProjectTemplateService.addFromTemplates(requests); // Loop through each response to see whether the request succeeded or failed for (pse.AddFromProjectTemplateService.AddFromProjectResponse response : responses) { if (response.isSuccess()) { System.debug('Successfully queued this request: ' + response.Request); } else { System.debug('This request failed: ' + response.Request); System.debug('Reasons: ' + response.Errors); } } DeprecatedThe following items are deprecated and not supported for use. We recommend that you stop using these items to avoid exceptions. MethodsaddTasksFromTemplatesDeprecated: Use addFromTemplates(List global static List<pse.AddFromProjectTemplateService.AddFromProjectResponse> addTasksFromTemplates(List<pse.AddFromProjectTemplateService.ProjectTaskRequest> requests) This method clones project tasks between projects using the details specified. Multiple requests are executed asynchronously and sequentially, in the given order. Input Parameters
Return ValueThis service returns AddFromProjectResponses in a list that parallels the input list. 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. Id template1 = 'a2V2F000000xpS3UAI'; Id template2 = 'a2V2F000000xpS4UAI'; Id destination = 'a2V2F000000xpSGUAY'; Date startDate = Date.Today(); pse.AddFromProjectTemplateService.ProjectTaskRequest request1 = new pse.AddFromProjectTemplateService.ProjectTaskRequest(template1, destination); pse.AddFromProjectTemplateService.ProjectTaskRequest request2 = new pse.AddFromProjectTemplateService.ProjectTaskRequest(template2, destination); request1.StartDate = startDate; request2.StartDate = startDate; List<pse.AddFromProjectTemplateService.ProjectTaskRequest> requests = new List<pse.AddFromProjectTemplateService.ProjectTaskRequest>{ request1, request2 }; // Enqueue the Add Tasks From Template requests List<pse.AddFromProjectTemplateService.AddFromProjectResponse> responses = pse.AddFromProjectTemplateService.addTasksFromTemplates(requests); // Loop through each response to see whether the request succeeded or failed for (pse.AddFromProjectTemplateService.AddFromProjectResponse response : responses) { if (response.isSuccess()) { System.debug('Successfully queued this request: ' + response.Request); } else { System.debug('This request failed: ' + response.Request); System.debug('Reasons: ' + response.Errors); } } pse.AddFromProjectTemplateService.AddFromProjectRequestglobal abstract class AddFromProjectRequest the request structure for the addfromprojecttemplateservice. Properties
pse.AddFromProjectTemplateService.ProjectTaskRequestglobal with sharing class ProjectTaskRequest extends AddFromProjectRequest the request structure for adding tasks from template only. to be used with addfromtemplates. This class extends pse.AddFromProjectTemplateService.AddFromProjectRequest Properties
MethodsProjectTaskRequestglobal ProjectTaskRequest(Id templateProjectId, Id destinationProjectId) A default constructor with minimum required properties. Input Parameters
pse.AddFromProjectTemplateService.MilestoneRequestglobal with sharing class MilestoneRequest extends AddFromProjectRequest the request structure for adding milestones from template only. to be used with addmilestonesfromtemplates. This class extends pse.AddFromProjectTemplateService.AddFromProjectRequest Properties
MethodsMilestoneRequestglobal MilestoneRequest(Id templateProjectId, Id destinationProjectId) A default constructor with minimum required properties. Input Parameters
pse.AddFromProjectTemplateService.ResourceRequestToProjectRequestglobal with sharing class ResourceRequestToProjectRequest extends AddFromProjectRequest the request structure for adding resource requests to a project. to be used with addfromtemplates. This class extends pse.AddFromProjectTemplateService.AddFromProjectRequest Properties
MethodsResourceRequestToProjectRequestglobal ResourceRequestToProjectRequest(Id templateProjectId, Id destinationProjectId) A default constructor with minimum required properties. Input Parameters
pse.AddFromProjectTemplateService.AddFromProjectResponseglobal class AddFromProjectResponse the response structure returned for each request. Properties
Methodspse.AddFromProjectTemplateService.AddFromProjectErrorglobal with sharing class AddFromProjectError stores error messages that occur when executing methods from addfromprojecttemplateservice. Properties
|