You are here:
Multi-Site Quote to Contract API
Converts the specified quote and it child records to a contract and related record. The API uses configurable Integration Procedures and Omnistudio Data Mappers in an asynchronous call for the processing of a large amount of data.
Integration Procedure Name: clm/asyncQuoteToContract
Using this API has three main scenarios.
-
Simple — Straight forward conversion of a Quote and its Line Items to Contract and Line Items.
-
Two Level — Given two levels of quotes (parent quote and sub-quotes) with line items beneath the quotes and quote group records grouping everything, the API creates the same structure with the contract, subcontract, and contract group records.
-
Flat — Given two levels of quotes (parent quote and sub-quotes) with line items beneath the quotes and quote group records grouping everything, the API creates only the parent contract and all the child records that relate to the parent contract.
The API takes parameters as a JSON string into an Integration Procedure and creates contract records using Data Mappers. Child records are created with Batch Actions that start Batch Apex Jobs which in turn call Integration Procedures with more Data Mappers.
The following table describes the key steps in the Integration Procedure:
Step Name | Step Type | Interface Name |
|---|---|---|
QueryParentQuote |
Data Mapper Extract Action |
QueryParentQuote |
CreateParentContract |
Data Mapper Extract Action |
CreateParentContract |
CreateParentContractVersion |
Data Mapper Extract Action |
CreateContractVersion |
ConvertGroupsToExclude |
Remote Action |
Class: ClmAppHandler Method: getConvertedGroupsToExclude |
QuerySubQuotes |
Data Mapper Extract Action |
QuerySubQuotes |
CreateSubContracts |
Data Mapper Post Action |
CreateSubContracts |
CreateSubContractVersions |
Data Mapper Post Action |
CreateSubContractVersions |
SetQuoteLineItemFieldsToQuery |
Set Values |
(none) |
CreateParentChildObjects |
Remote Action This step calls the clm_CreateParentContractChildObjects Integration Procedure for creating line item records. It also calls the clm_CreateContractDiscounts Integration Procedure for creating discount records. |
Class: CreateContractChildObjectsBatch Method: processParentChildren |
CreateSubChildObjects |
Remote Action This step calls the clm_CreateSubContractChildObjects Integration Procedure for creating line item records. It also calls the clm_CreateContractDiscounts Integration Procedure for creating discount records. |
Class: CreateContractChildObjectsBatch Method: processSubChildren |
ResponseAction |
Response Action |
(none) |
Parameters
To configure, click Preview, and enter values for the following parameters in the Input Parameter pane.
Parameter | Description |
|---|---|
ObjectId |
Salesforce record ID of the quote to process. |
processSubQuotes |
Boolean designating whether to create sub-quote records. |
contractHierarchyType |
ENUM designating the structure to create:
|
ParentContractStartDate |
Date string for setting the Start Date field on the Parent contract. The string must have the format of MM/DD/YYYY. |
SubContractStartDate |
Date string for setting the Start Date field on all of the subcontracts. The string must have the format of MM/DD/YYYY. |
ParentContractTerm |
Integer for setting the Term field on the top level contract. |
SubContractTerm |
Integer for setting the Term field on all the sub-level contracts. |
ParentContractRecordType |
String of the contract record type developer name that is to be used for the top level contract. |
SubContractRecordType |
String of the contract record type developer name that is to be used for the sub-level contracts. |
isFrameAgreementParent |
Boolean representing whether to process the top-level contract as a frame agreement. If true, discount records are created and the Is Frame Contract field is set on the top level contract. |
isFrameAgreementSub |
Boolean representing whether to process the sub-level contracts as a frame agreement. If true, discount records are created and the Is Frame Contract field is set on the sub-level contracts. |
autoGenerateParent |
Boolean representing whether to generate documents for the top level contract after it is created. |
autoGenerateSub |
Boolean representing whether to generate documents for the sub-level contracts after all contracts are created. |
groupsToExclude |
String in CSV format of quote group IDs not to process. |
groupsToExcludeList |
List of objects containing the string “Id” as the key and value is the Salesforce ID. |
Example
Example of a request:
{
"Id": "0Q06g000000XxchCAC",
"processSubQuotes": "true",
"contractHierarchyType": "Two Level",
"ParentContractStartDate": "5/28/2020",
"SubContractStartDate": "5/29/2020",
"ParentContractTerm": "12",
"SubContractTerm": "6",
"SubContractRecordType": "0126g000000nkQ7AAI",
"ParentContractRecordType": "0126g000000nkQ2AAI",
"isFrameAgreementParent": "true",
"isFrameAgreementSub": "true",
"autoGenerateParent": "false",
"autoGenerateSub": "false",
"groupsToExcludeList": [
{
"Id": "a4H6g000000TmADEA0",
"Id": "a4H6g000000TmADEB0"
}
]
}Example of output:
{ParentContractId=8006g000000iNCaAAM}