ffscpq.CreateScopingSessionServiceglobal with sharing class CreateScopingSessionService A service that provides functionality related to creating scoping sessions. Methods
createScopingSessionglobal static ffscpq.CreateScopingSessionService.CreateScopingSessionResponse createScopingSession(ffscpq.CreateScopingSessionService.CreateScopingSessionRequest request) A method that creates a scoping session. Input Parameters
Return ValueThis service returns a CreateScopingSessionResponse. 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.
// Add opportunity ID to populate lookup on the created scoping session.
Id opportunityId = '006DR00000KhTNYYA3';
// Build request
ffscpq.CreateScopingSessionService.CreateScopingSessionRequest request = new ffscpq.CreateScopingSessionService.CreateScopingSessionRequest(
opportunityId
);
// Optionally add a list of estimate product IDs to add to the created scoping session.
request.EstimateProductIds = new List<Id>{ 'a5FDR000001Qpxt2AC' };
// Optionally add a name to the created scoping session.
request.Name = 'Scoping Session created using global service';
// Call the global service with the previously created request list.
ffscpq.CreateScopingSessionService.CreateScopingSessionResponse response = ffscpq.CreateScopingSessionService.createScopingSession(
request
);
// Extract the response data.
System.debug('Created Scoping session ID: ' + response.ScopingSession);
System.debug(
'Created Scoping Session Estimate Product IDs: ' + response.ScopingSessionEstimateProductIds
);
createScopingSessionsglobal static List<ffscpq.CreateScopingSessionService.CreateScopingSessionResponse> createScopingSessions(List<ffscpq.CreateScopingSessionService.CreateScopingSessionRequest> requests) A method that creates multiple scoping sessions. Input Parameters
Return ValueThis service returns a list of CreateScopingSessionResponse. 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.
// A list of opportunity IDs to create scoping sessions for.
List<Id> opportunityIds = new List<Id>{ '006DR00000KhTNYYA3', '006DR00000KhTNZYA3' };
// Build requests for each opportunity.
List<ffscpq.CreateScopingSessionService.CreateScopingSessionRequest> requests = new List<ffscpq.CreateScopingSessionService.CreateScopingSessionRequest>();
for (Id opportunityId : opportunityIds) {
ffscpq.CreateScopingSessionService.CreateScopingSessionRequest request = new ffscpq.CreateScopingSessionService.CreateScopingSessionRequest(
opportunityId
);
// Optionally add a list of estimate product IDs to add to the created scoping session.
request.EstimateProductIds = new List<Id>{ 'a5FDR000001Qpxt2AC' };
// Optionally add a name to the created scoping session.
request.Name = 'Scoping Session created using global service';
requests.add(request);
}
// Call the global service with the previously created request list.
List<ffscpq.CreateScopingSessionService.CreateScopingSessionResponse> responses = ffscpq.CreateScopingSessionService.createScopingSessions(
requests
);
// Extract the response data.
for (ffscpq.CreateScopingSessionService.CreateScopingSessionResponse response : responses) {
System.debug('Created Scoping session ID: ' + response.ScopingSession);
System.debug(
'Created Scoping Session Estimate Product IDs: ' + response.ScopingSessionEstimateProductIds
);
}
ffscpq.CreateScopingSessionService.CreateScopingSessionRequestglobal with sharing class CreateScopingSessionRequest The request structure for creating a scoping session. Properties
MethodsCreateScopingSessionRequestglobal CreateScopingSessionRequest(Id opportunityId) ffscpq.CreateScopingSessionService.CreateScopingSessionResponseglobal with sharing class CreateScopingSessionResponse The response structure for creating a scoping session. Properties
MethodsCreateScopingSessionResponseglobal CreateScopingSessionResponse(Id scopingSessionId, List<Id> ScopingSessionEstimateProductIds) |