ServiceContractService
{
global static SVMXA360.SvmxGlobal.SvmxResponse createServiceContract(ServiceContractData serviceContractData){
return new SCON_ServiceContractPlanHandler().createServiceContract(serviceContractData);
}
|
Parameters
|
Mandatory (Yes/No)
|
Description
|
||
|---|---|---|---|---|
|
accountId
|
Yes
|
the SFDC record ID of the Account record.
|
||
|
startDate
|
Yes
|
the Start Date of the Service Contract.
|
||
|
endDate
|
No
|
the End Date of the Service Contract. If not provided, EndDate is calculated as StartDate + Duration in Plan.
|
||
|
pricebookId
|
No
|
the Pricebook to be used for Service Contract. If not provided, use it from Contract Plan's pricebook.
|
||
|
servicePlanProductId
|
Yes
|
the Product ID or ID of the Service Contract Plan in Service Contract Plan. When this is provided, use the Contract Plan that is linked to this ProductId. There should be only one Contract Plan for a given Product ID.
|
||
|
isCLIPlanProductId
|
No
|
The Boolean variable to look on Applicable Contract Line Product Id.
|
||
|
serviceContractName
|
Yes
|
the name of the Service Contract Name.
|
||
|
description
|
No
|
the description of the Service Contract that is to be created.
|
||
|
salesContractId
|
No
|
the record ID of the Sales Contract that is to be populated on a custom field on Service Contract.
|
||
|
salesContractIdFieldAPIName
|
No
|
the field name related to Sales Contract on Service Contract.
|
{
"accountId": "",
"startDate": "",
"endDate": "",
"pricebookId": "",
"servicePlanProductId": "",
"isCLIPlanProductId": "",
"serviceContractName": "",
"description": "",
"salesContractId": "",
"salesContractIdFieldAPIName": ""
}
// Create request object
ServiceContractData serviceContractData = new ServiceContractData();
// Populate data in the request
serviceContractData.accountId='lsdffss'; // SF Account record Id
serviceContractData.servicePlanProductId='wsfczdsda'; // SF Product Record Id
serviceContractData.startDate=System.today();
serviceContractData.serviceContractName='Test SCON';
serviceContractData.salesContractIdFieldName='Description'; // Custom/Managed Field API Name
serviceContractData.salesContractId='description field'; // Value for the Custom/Managed Field
// Calling Global method to create service contract
SVMXA360.SvmxGlobal.SvmxResponse response = ServiceContractService.createServiceContract(serviceContractData);
System.debug('Response: ' + response);
|
Parameters
|
Description
|
|---|---|
|
accountId
|
the SFDC record Id of the Account record as provided in the request.
|
|
startDate
|
the Start Date of the Service Contract as provided in the request.
|
|
endDate
|
the End Date of the Service Contract as provided in the request.
|
|
pricebookId
|
the Pricebook to be used for the Service Contract as provided in the request.
|
|
servicePlanProductId
|
the Product Id or the ID of the Service Contract Plan in Service Contract Plan as provided in the request.
|
|
isCLIPlanProductId
|
the Boolean variable to look on Applicable Contract Line Product ID.
|
|
salesContractId
|
the record Id of the Sales Contract is to be populated on a custom field on the Service Contract as provided in the request.
|
|
salesContractIdFieldAPIName
|
the field name related to Sales Contract on Service Contract as provided in the request.
|
|
serviceContractId
|
the SFDC record id of the Service Contract that was created.
|
|
error
|
Any error would go under the error variable in SvmxGlobal class.
|
{
"success": true,
"message": "",
"data": {
"accountId": "",
"startDate": "",
"endDate": "",
"pricebookId": "",
"servicePlanProductId": "",
"isCLIPlanProductId": "",
"salesContractId": "",
"salesContractIdFieldAPIName": "",
"serviceContractId":""
},
"errors": []
}