Service Contract API Developer's Reference

scmsc.ChangeRequestAPI

global with sharing class ChangeRequestAPI

This API class is used to create change requests, create change request lines and apply changes back to the service contract.

Author

FinancialForce.com, inc

Date

7/06/2015

Methods

applyChangeRequestToContract

global static string applyChangeRequestToContract(Id ApprovedChangeRequestId)

Applies the changes from a single change request to the service contract associated with it.

Input Parameters

Name Type Description
ApprovedChangeRequestId Id The approved change request id to apply changes from.

Exceptions Thrown

Value Description
ChangeRequestException when the service contract cannot be update from the change request.

Return Value

Status indicating success, failure reason, or that a batch job has been scheduled.

applyChangesToContractThroughChangeReq

global static Id applyChangesToContractThroughChangeReq(Id Service_Contract_Id, list<scmsc.apiCRLExtended> API_CRL_Extended_List)

Creates a change request and submits it for approval based on the changes being requested in the list file.

Input Parameters

Name Type Description
Service_Contract_Id Id The service contract id to which the change is to be applied.
API_CRL_Extended_List list<scmsc.apiCRLExtended> List of apiCRLExtended objects that identifies the contract line, field and new value.

Exceptions Thrown

Value Description
ChangeRequestException when the change cannot be applied to a change request line.

Return Value

Id of the change request created.

createChangeRequest

global static SCMC__Change_Request__c createChangeRequest(Id Service_Contract_Id)

Creates a single change request.

Input Parameters

Name Type Description
Service_Contract_Id Id The service contract id for which the change request is being created.

Exceptions Thrown

Value Description
ChangeRequestException when the change request cannot be create for a contract.

Return Value

Id of the change request created.

newChangeRequestLine

global static SCMC__Change_Request_Line__c newChangeRequestLine(Id ChangeRequestId)

Creates a blank change request line.

Input Parameters

Name Type Description
ChangeRequestId Id The change request id to which the new change request line belongs.

Exceptions Thrown

Value Description
ChangeRequestException when the change request line cannot be create.

Return Value

Blank change request line SCMC__Change_Request_Line__c

newChangeRequestLineForSCL

global static SCMC__Change_Request_Line__c newChangeRequestLineForSCL(Id SerivceContractLineID, Id ChangeRequestId)

Creates a change request line for a single contract line.

Input Parameters

Name Type Description
SerivceContractLineID Id The service contract id for which the change request line is being created.
ChangeRequestId Id The change request id to which the new change request line belongs.

Exceptions Thrown

Value Description
ChangeRequestException when the change request line cannot be create.

Return Value

Change request line SCMC__Change_Request_Line__c associated with the service contract.

submitChangeRequestForApproval

global static string submitChangeRequestForApproval(Id ChangeRequestId)

Submits a change request for Approval.

Input Parameters

Name Type Description
ChangeRequestId Id The change request id to be submitted for approval.

Exceptions Thrown

Value Description
ChangeRequestException when the contract line is being converted to change request line.

Return Value

Status code indicating success or a failure reason.