Creating Collaboration Request
This API provides functionality to create collaboration requests. When invoked, it generates a collaboration request record along with a child cart that includes the line items defined in the input parameters. Additionally, the collaboration request is automatically assigned to the user specified in the code, ensuring that the request is routed to the appropriate recipient for action..
API | Signature |
---|---|
createCollaborationRequest | static Apttus_Config2.CollabStruct.CreateCRResponseDO createCollaborationRequest(Apttus_Config2.CollabStruct.CreateCRRequestDO requestDO) |
Request Parameter | ||
---|---|---|
Name | Type | Description |
parentConfigId | ID | The ID of the parent configuration record. |
parentLineItemIds | LIST | A list of parent line item IDs to be associated with the collaboration. |
collaborationRequestSO | Object | Collaboration request object that defines priority, type, and owner. |
Response Parameters | ||
---|---|---|
Field | Type | Description |
success | Boolean | Indicates whether the request was successfully created. |
collaborationRequestId | ID | The ID of the newly created collaboration request. |
message | String | Status message or error |
Code Sample
The sample code below enables you to create collaboration request. After the API is executed, the collaboration request is created.
// Create Collaboration Request
Apttus_Config2__ProductConfiguration__c configSO = [SELECT Id, Name FROM Apttus_Config2__ProductConfiguration__c WHERE Id = 'a1lbn000001Q6nbAAC'];
System.debug('Product Configuration SO : '+configSO);
Apttus_Config2__LineItem__c LineItemSO = [SELECT Id, Name FROM Apttus_Config2__LineItem__c WHERE Id = 'a1Vbn00000BbG2KEAV' LIMIT 1];
System.debug('Line Items SO : '+LineItemSO);
Apttus_Config2__CollaborationRequest__c collabRequestSO = new Apttus_Config2__CollaborationRequest__c();
collabRequestSO.Apttus_Config2__Priority__c = 'P2';
collabRequestSO.Apttus_Config2__CollaborationType__c = 'Multi-Tier';
collabRequestSO.OwnerId = '005bn00000B2ma5AAB';
// Step I: Create a new collaboration request
Apttus_Config2.CollabStruct.CreateCRRequestDO CRD = new Apttus_Config2.CollabStruct.CreateCRRequestDO();
CRD.collaborationRequestSO = collabRequestSO;
System.debug('Collaboration Request DO : '+CRD);
CRD.parentConfigId = configSO.Id;
CRD.parentLineItemIds.add(LineItemSO.Id);
Apttus_Config2.CollabStruct.CreateCRResponseDO createCRResponse = Apttus_Config2.QuoteCollaborationService.createCollaborationRequest(CRD);
System.debug('Create Collaboration Request Response : '+createCRResponse);