Billing Central Apex API Developer Reference

ffbc.ContractsService

global with sharing class ContractsService

This class provides service functionality for Billing Central contracts.

Enums

Status

An enum that represents the valid options for the status of contracts.

Value Description
Draft Option to set the status of the contract to Draft.
Active Option to set the status of the contract to Active.
Superseded Option to set the status of the contract to Superseded.
Expired Option to set the status of the contract to Expired.

Type

An enum that represents the valid options for the contract type.

Value Description
Contract Option that shows the object represented is a Contract.
ChangeRequest Option that shows the object represented is a Change Request.
Renewal Option that shows the object represented is a Renewal.

RenewalLineDurationOption

An enum that represents the valid options for the duration of line items when creating a renewal.

Value Description
KeepSame Option to keep the same duration for the line item in the renewed contract.
ExtendToMatchContractDuration Option to extend the duration for the line item in the renewed contract to the same duration as the contract.

Methods

activate

This method has been deprecated, use activation instead.

global static void activate(ffbc.ContractsService.ActivationRequest request)

Activates the contracts provided by changing their status to Active and starting an asynchronous process to create the first billing schedules for them.

Input Parameters

Name Type Description
request ffbc.ContractsService.ActivationRequest Wrapper containing the contracts to be activated and the criteria for which to create billing schedules.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the number of months for which to generate schedules is negative or is greater than the maximum allowed.

activationAsync

global static Id activationAsync(ffbc.ContractsService.ActivationRequest request)

Activates the contracts provided by changing their status to Active using a background process. This returns an ID for the background process that is processing the contracts. An asynchronous process is then started to create the first billing schedules for the contracts.

Input Parameters

Name Type Description
request ffbc.ContractsService.ActivationRequest Wrapper containing the contracts to be activated and the criteria for which to create billing schedules.

activation

global static ffbc.ContractsService.ActivationResponse activation(ffbc.ContractsService.ActivationRequest activationRequest)

Activates the contracts provided by changing their status to Active. An asynchronous process is then started to create the first billing schedules for the contracts.

Input Parameters

Name Type Description
activationRequest ffbc.ContractsService.ActivationRequest Wrapper containing the contracts to be activated and the criteria for which to create billing schedules.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the number of months for which to generate schedules is negative or is greater than the maximum allowed.

Return Value

A response object containing the errors that occurred while activating contracts.

load

global static List<ffbc.ContractsService.Contract> load(Set<Id> contractIds)

Returns all contracts and contract line items based on the Ids of the contract.

Input Parameters

Name Type Description
contractIds Set<Id> Set of contract Ids for which to return contract and contract line item information.

Return Value

A list of contracts and their corresponding line items. The line items for a contract will be ordered by their Contract Line Item Number.

save

global static Set<Id> save(List<ffbc.ContractsService.Contract> contractsToSave)

Converts the Contract objects provided into ffbc__Contract__c SObjects and then inserts or updates them as necessary. This method cannot be used to insert change requests. To insert a change request call saveNewChangeRequest.

Input Parameters

Name Type Description
contractsToSave List<ffbc.ContractsService.Contract> The Contract objects to convert and save.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if any of the records have invalid data.
BillingCentralException An exception is thrown if this method is used to insert a change request.

Return Value

The set of IDs of the inserted/updated ffbc__Contract__c objects.

deleteContracts

global static void deleteContracts(Set<Id> contractsToDelete)

Deletes the contracts with the IDs provided.

Input Parameters

Name Type Description
contractsToDelete Set<Id> The IDs of the Contracts to delete.

calculateTotalValues

This method has been deprecated and always throws an exception to indicate that it cannot be invoked.

global static ffbc.Response calculateTotalValues(Set<Id> contractsToCalculateTotalValue)

Input Parameters

Name Type Description
contractsToCalculateTotalValue Set<Id> The IDs of the Contracts to be processed.

Exceptions Thrown

Value Description
An exception to inform that the method has been deprecated

Return Value

Null.

calculateFields

global static ffbc.ContractsService.CalculateFieldsResponse calculateFields(ffbc.ContractsService.CalculateFieldsRequest calculateRequest)

Calculates the projected value and totals for the specified contracts over their lifetime. The total value fields of the contracts are updated. To achieve this, the Sales Price Override field is calculated to ensure that the Monthly Recurring Revenue and Annual Recurring Revenue values are correct. If errors are encountered during calculation, fields that could not be calculated will be set to null.

Input Parameters

Name Type Description
calculateRequest ffbc.ContractsService.CalculateFieldsRequest The request containing the Contracts to be processed.

Return Value

A CalculateFieldsResponse containing the errors that occurred for each contract.

calculateFieldsWithoutSave

global static ffbc.ContractsService.CalculateFieldsWithoutSaveResponse calculateFieldsWithoutSave(ffbc.ContractsService.CalculateFieldsWithoutSaveRequest request)

Calculates the projected value and totals for the specified contracts over their lifetime. This is an equivalent to the calculateFields method that can be used without having a contract saved on the database. For example, this could be used to preview the effect of changing a contract, or to correctly set the sales prices and total values before saving.

Input Parameters

Name Type Description
request ffbc.ContractsService.CalculateFieldsWithoutSaveRequest Information for the contract that determines the prices of the lines and the total value over the contract's lifetime. The Identifier specified for contracts and lines on the request is preserved on the response to allow matching between request and response.

Return Value

A response containing the values calculated for each contract. Contracts and lines are returned in the order that they are present in the request. In the event that a contract or line has missing or invalid information, a warning is included and any fields that could not be calculated are returned as null.

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.

/**
 * This sample shows how to use the ffbc.ContractsService.calculateFieldsWithoutSave method to work out the sales price and total value of the
 * lines of a contract before saving it. This allows you to set these fields to their correct values before saving a new contract
 * on the database, or to make decisions based on their values.
 */

//Given a contract that has been constructed elsewhere
ffbc.ContractsService.Contract contractToSave;

ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderRequest headerRequest = new ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderRequest();
headerRequest.Identifier = contractToSave.Id;
headerRequest.EndDate = contractToSave.EndDate;

List<ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest> lineRequests = new List<ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest>();
for (ffbc.ContractsService.ContractLineItem line : contractToSave.LineItems)
{
    ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest lineRequest = new ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest();
    lineRequest.Identifier = line.Id;
    lineRequest.Quantity = line.Quantity;
    lineRequest.UnitPrice = line.UnitPrice;
    lineRequest.StartDate = line.StartDate;
    lineRequest.EndDate = line.EndDate;
    lineRequest.BillingType = line.BillingType;
    lineRequest.BillingTerm = line.BillingTerm;
    lineRequest.Discount = line.Discount;
    lineRequest.PricingType = line.PricingStructure.PricingType;
    lineRequest.QuantityBreaks = line.PricingStructure.QuantityBreaks;
    lineRequests.add(lineRequest);
}

headerRequest.Lines = lineRequests;

ffbc.ContractsService.CalculateFieldsWithoutSaveRequest request = new ffbc.ContractsService.CalculateFieldsWithoutSaveRequest();
request.Contracts = new List<ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderRequest>{headerRequest};

ffbc.ContractsService.CalculateFieldsWithoutSaveResponse response = ffbc.ContractsService.calculateFieldsWithoutSave(request);
ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderResponse contractResponse = response.Contracts[0];

if (contractResponse.TotalContractValue > 10000)
{
    //We now know what values the contract would have before saving, so pre-emptive action can be taken if, for
    //example, high-value contracts need extra operations.
}

//We can now set the values on the contract that is to be saved, so it will save with the correct sales prices, total line values
//and total contract value.
contractToSave.TotalContractValue = contractResponse.TotalContractValue;
for (Integer i = 0, size = contractToSave.LineItems.size(); i < size; i++)
{
    ffbc.ContractsService.ContractLineItem lineToSave = contractToSave.LineItems[i];
    ffbc.ContractsService.CalculateFieldsWithoutSaveLineResponse lineResponse = contractResponse.Lines[i];
    if (lineToSave.Id != lineResponse.Identifier)
    {
        System.assert(false, 'The line responses will be returned in the same order that the requests are passed in, '
        + 'so for this sample these values will always match. If you cannot use the ordering, you can use the '
        + 'Identifier on the line response to work out which request line it corresponds to.');
    }

    lineToSave.SalesPriceOverride = lineResponse.SalesPriceOverride;
    lineToSave.TotalContractLineValue = lineResponse.TotalContractLineValue;
}

getContractSummariesForAccount

global static List<ffbc.ContractsService.ContractSummary> getContractSummariesForAccount(Set<Id> accountIds)

Retrieves the contracts associated with the account using the account IDs provided and returns summary wrappers for them.

Input Parameters

Name Type Description
accountIds Set<Id> The IDs of the accounts on which to filter.

Return Value

A list of wrappers of the contract summary information for each contract retrieved.

getContractSummariesForBillingDocumentRelation

global static List<ffbc.ContractsService.ContractSummary> getContractSummariesForBillingDocumentRelation(ffbc.ContractsService.ContractSummaryRequest request)

Retrieves summaries of contracts that can be associated with billing documents. This only includes contracts with the status Draft, Active or Expired.

Input Parameters

Name Type Description
request ffbc.ContractsService.ContractSummaryRequest The object containing the parameters for which to retrieve contracts.

Return Value

A list of summaries for the contracts.

createChangeRequest

global static Id createChangeRequest(Id contractId)

Creates a change request for the contract ID provided. This creates the change request and returns its ID. All values of custom fields on the active contract are copied to the change request. When a change request is created from a contract, pricing structures on the active contract line items are copied and the copies are applied to the change request line items. Pricing structures on active contract line items are unaffected by changes made to pricing structures on change request line items.

Input Parameters

Name Type Description
contractId Id The ID of the contract for which to create a change request.

Return Value

The ID of the change request record created.

createChangeRequestObject

global static ffbc.ContractsService.Contract createChangeRequestObject(Id contractId)

Creates a change request for the contract provided. This copies the contract and returns a populated ffbc.ContractsService.Contract DTO that represents the new change request. This does not insert the new record into the database. The ID properties of the returned contract and its lines are null. When a change request is created from a contract, pricing structures on the active contract line items are copied and the copies are applied to the change request line items. Pricing structures on active contract line items are unaffected by changes made to pricing structures on change request line items.

Input Parameters

Name Type Description
contractId Id The ID of the contract for which to create a change request.

Return Value

The ContractsService.Contract DTO for the change request created.

saveNewChangeRequest

global static Id saveNewChangeRequest(ffbc.ContractsService.Contract changeRequest)

Saves a new change request to the database. All custom fields that are not included in the object provided are copied from the existing active contract to which the new change request relates.

Input Parameters

Name Type Description
changeRequest ffbc.ContractsService.Contract The change request object to be saved.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the contract provided is not of type ChangeRequest or it already has an ID.

Return Value

ID of the inserted ffbc__Contract__c object for the change request.

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.

/**
 * Example of creating a Change Request, where the change is adding a new line to the Contract.
 * Variables marked by asterisks need to be queried from your organisation's data.
 */

ffbc.ContractsService.Contract changeRequest = ffbc.ContractsService.createChangeRequestObject(*contractId*);

//Lines on a Change Request must always be ready for billing, so Billing Term, Billing Type and First Bill Date must be set.
//If the EndDate is not specified then it will be copied from the header.
ffbc.ContractsService.ContractLineItem newLineItem = new ffbc.ContractsService.ContractLineItem();
newLineItem.ProductService = *productId*;
newLineItem.BillingTerm = *billingTermId*;
newLineItem.StartDate = System.today();
newLineItem.FirstBillDate = System.today();
newLineItem.UnitPrice = 50;
newLineItem.Quantity = 1;
newLineItem.BillingType = ffbc.BillingService.BillingType.RecurringFixed;
changeRequest.addLineItem(newLineItem);

ffbc.ContractsService.saveNewChangeRequest(changeRequest);

applyChangeRequests

global static ffbc.ContractsService.ApplyChangeRequestsResponse applyChangeRequests(ffbc.ContractsService.ApplyChangeRequestsRequest request)

Applies each change request specified in the request object to the active contract to which it belongs. This also generates billing schedules for the number of months specifed in the request.

Input Parameters

Name Type Description
request ffbc.ContractsService.ApplyChangeRequestsRequest Wrapper containing the change request to be applied and the criteria for generating billing schedules.

Return Value

The Response object containing errors that occurred or the active contract IDs of the change requests that were applied.

createRenewalsWithNoPriceChange

global static ffbc.ContractsService.CreateRenewalResponse createRenewalsWithNoPriceChange(ffbc.ContractsService.CreateRenewalRequest request)

Creates renewals for the contract IDs provided without pricing changes. This creates renewals and returns their IDs. All values of custom fields on the active contracts are copied to the renewals.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.

Return Value

The Response object containing errors that occurred and the IDs of the renewals that were created.

createRenewalsWithPercentageAdjustment

global static ffbc.ContractsService.CreateRenewalResponse createRenewalsWithPercentageAdjustment(ffbc.ContractsService.CreateRenewalWithPercentageAdjustmentRequest request)

Creates renewals for the contract IDs provided with pricing changes based on the percentage adjustment. This creates renewals and returns their IDs. All values of custom fields on the active contracts are copied to the renewals.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalWithPercentageAdjustmentRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.
- A decimal that determines how much the value of all unit prices is to be increased or decreased by.

Return Value

The Response object containing errors that occurred and the IDs of the renewals that were created.

createRenewalsFromPricebook

global static ffbc.ContractsService.CreateRenewalResponse createRenewalsFromPricebook(ffbc.ContractsService.CreateRenewalWithPricebookRequest request)

Creates renewals for the contract IDs provided with pricing changes from the price book provided. This creates renewals and returns their IDs. All values of custom fields on the active contracts are copied to the renewals.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalWithPricebookRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.
- The ID of the price book from which to get the unit prices to be applied to the renewal.

Return Value

The Response object containing errors that occurred and the IDs of the renewals that were created.

createRenewalsWithNoPriceChangeAsync

global static Id createRenewalsWithNoPriceChangeAsync(ffbc.ContractsService.CreateRenewalRequest request)

Creates renewals for the contract IDs provided using a batch or queueable background process. This creates the renewals without pricing changes and returns the ID of the batch or queueable process used. All values of custom fields on the active contracts are copied to the renewals. The start, end and first bill dates are set depending on the RenewalLineDurationOption value.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.

Return Value

The ID of the asynchronous process that is to create the renewals.

createRenewalsWithPercentageAdjustmentAsync

global static Id createRenewalsWithPercentageAdjustmentAsync(ffbc.ContractsService.CreateRenewalWithPercentageAdjustmentRequest request)

Creates renewals for the contract IDs provided using a batch or queueable background process. This creates the renewals with pricing changes based on the percentage adjustment and returns the ID of the batch or queueable process used. All values of custom fields on the active contracts are copied to the renewals. The start, end and first bill dates are set depending on the RenewalLineDurationOption value.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalWithPercentageAdjustmentRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.
- A decimal that determines how much the value of all unit prices is to be increased or decreased by.

Return Value

The ID of the asynchronous process that is to create the renewals.

createRenewalsFromPriceBookAsync

global static Id createRenewalsFromPriceBookAsync(ffbc.ContractsService.CreateRenewalWithPricebookRequest request)

Creates renewals for the contract IDs provided using a batch or queueable background process. This creates the renewals with pricing changes from the price book provided and returns the ID of the batch or queueable process used. All values of custom fields on the active contracts are copied to the renewals. The start, end and first bill dates are set depending on the RenewalLineDurationOption value.

Input Parameters

Name Type Description
request ffbc.ContractsService.CreateRenewalWithPricebookRequest Wrapper class implementation containing:
- The ID of the contract for which to create a renewal.
- A RenewalLineDurationOption that indicates whether to extend the start, end and first bill dates of the renewal.
- The ID of the price book from which to get the unit prices to be applied to the renewal.

Return Value

The ID of the asynchronous process that is to create the renewals.

getAdditionalFieldMetadata

global static List<ffbc.FieldMetadata> getAdditionalFieldMetadata()

Retrieves metadata for additional contract and contract line item fields that are visible when viewing, creating and editing a contract.

Return Value

A list of metadata wrappers for additional fields.

expire

global static ffbc.ContractsService.ExpireResponse expire(ffbc.ContractsService.ExpireRequest request)

Expires active contracts using the contract IDs provided.

Input Parameters

Name Type Description
request ffbc.ContractsService.ExpireRequest Wrapper containing the contract IDs for which to expire active contracts.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown when a valid active contract cannot be expired.

Return Value

An ExpireResponse object containing the errors that occurred and the IDs of the contracts that were expired.

expireAsync

global static Id expireAsync(ffbc.ContractsService.ExpireRequest request)

Expires active contracts for the contract IDs provided using a batch or queueable background process. If no IDs are provided all valid active contracts are expired.

Input Parameters

Name Type Description
request ffbc.ContractsService.ExpireRequest Wrapper containing the contract IDs for which to expire active contracts.

Return Value

The ID of the asynchronous process that is to expire the contracts.

end

global static ffbc.ContractsService.EndingResponse end(Map<Id, ffbc.ContractsService.EndingParameter> endingRequestMap)

Ends active contracts early using the requested new end date, reason for ending the contract and additional notes. An error occurs if the contract is associated with an open change request that has not been rejected or a draft renewal.

Input Parameters

Name Type Description
endingRequestMap Map<Id, ffbc.ContractsService.EndingParameter> Map of Contract IDs to ContractsService.EndingParameter. The ending parameter contains the end date, reason for ending the contract and a note.

Return Value

A response containing the results from the process. The response contains the list of the contracts successfully processed and the errors associated with each Contract ID.

endAndClean

global static ffbc.ContractsService.EndingResponse endAndClean(Map<Id, ffbc.ContractsService.EndingParameter> endingRequestMap)

Ends active contracts using the requested new end date, reason for ending the contract and additional notes. If the contracts are associated with open change requests that have not been rejected or draft renewals, these are automatically deleted.

Input Parameters

Name Type Description
endingRequestMap Map<Id, ffbc.ContractsService.EndingParameter> Map of Contract IDs to ContractsService.EndingParameter. The ending parameter contains the end date, reason for ending the contract and additional notes.

Return Value

A response containing the results from the process. The response contains the list of the contracts successfully processed and the errors associated with each Contract ID.

validateForScheduleGeneration

global static void validateForScheduleGeneration(ffbc.ContractsService.ValidateForScheduleGenerationRequest request)

Checks the contract information provided and determines whether it is valid to generate schedules for that contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForScheduleGenerationRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the request contains: A contract type other than Contract. A status other than Active or Expired.

validateForFieldsCalculation

global static void validateForFieldsCalculation(ffbc.ContractsService.ValidateForFieldsCalculationRequest request)

Checks the contract information provided and determines whether it is valid to calculate the total reporting fields of the contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForFieldsCalculationRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the request contains: A status other than Draft, Active or Expired.

validateForTotalValueCalculation

This method has been deprecated and always throws an exception to indicate that the new method should be used.

global static void validateForTotalValueCalculation(ffbc.ContractsService.ValidateForTotalValueCalculationRequest request)

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForTotalValueCalculationRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception to inform that the method has been deprecated.

validateForCreatingBillingDocument

global static void validateForCreatingBillingDocument(ffbc.ContractsService.ValidateForCreatingBillingDocumentRequest request)

Checks the contract information provided and determines whether it is valid to create billing documents for that contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForCreatingBillingDocumentRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the request contains: A contract type of Change Request. A status other than Active or Expired.

validateForActivation

global static ffbc.Response validateForActivation(ffbc.ContractsService.ValidateForActivationRequest request)

Checks the contracts provided and determines whether they are valid to be activated.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForActivationRequest Wrapper containing the IDs of contracts to be validated.

Return Value

A Response that holds the errors relating to the validated Contracts. Errors are returned if: A contract has a status other than draft. A contract has a type other than Contract. A contract has no related contract lines. Any of the contract line items do not contain a billing type. Any of the contract line items do not contain a billing term. Any of the contract line items do not contain a first bill date.

validateForAddPlan

global static void validateForAddPlan(ffbc.ContractsService.ValidateForAddPlanRequest request)

Checks the contract information provided and determines whether it is valid to add plans to that contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForAddPlanRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the request contains a status other than Draft or Active.

validateForEnding

global static void validateForEnding(ffbc.ContractsService.ValidateForEndingRequest request)

Checks the contract information provided and determines whether it is valid to end that contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForEndingRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if the request contains a status other Active or the type is not Contract.

validateForCreatingRenewal

global static void validateForCreatingRenewal(ffbc.ContractsService.ValidateForCreatingRenewalRequest request)

Checks the contract information provided and determines whether it is valid to create a renewal for that contract.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForCreatingRenewalRequest Wrapper containing the contract information to be validated.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown if: The contract type is not Contract. The status is not Active or Expired. There is no end date. There is a related renewal.

assignProrationPolicy

global static ffbc.ContractsService.AssignProrationPolicyResponse assignProrationPolicy(ffbc.ContractsService.AssignProrationPolicyRequest request)

Assigns a proration policy to contracts and updates their values. If the contracts are active, and your settings allow updating the proration policy on active contracts, draft billing documents will be deleted or discarded, and any billing schedules that have not been billed will be updated. Only the first and last periods of each contract will be prorated.

Input Parameters

Name Type Description
request ffbc.ContractsService.AssignProrationPolicyRequest Specifies the contracts and the proration policy to assign to them.

Exceptions Thrown

Value Description
BillingCentralException An exception is thrown when a proration policy cannot be assigned due to a fatal error that could not be associated with a particular contract, for example a failure in updating billing schedules or billing documents.

Return Value

The contracts that have been updated, and errors for contracts that could not be updated.

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.

/**
 * This sample shows how to use the ffbc.ContractsService.assignProrationPolicy method to assign a proration policy
 * to a collection of contracts in bulk. This service is synchronous so you will get the results immediately but you
 * will not be able to update any more than 10000 contracts. To update more than 10000 contracts use the asynchronous
 * version of this method (ffbc.ContractsService.assignProrationPolicyAsync).
 */

//Given a collection of contract IDs and a proration policy ID
Set<Id> contractIds;
Id prorationPolicyId;

// Build a request object specifying the contract IDs that you want updated and the ID of the proration policy
// that you want to be applied to the contracts.
ffbc.ContractsService.AssignProrationPolicyRequest request = new ffbc.ContractsService.AssignProrationPolicyRequest();
request.ContractIds = contractIds;
request.ProrationPolicyId = prorationPolicyId;

// Send the request to the service and receive the response
ffbc.ContractsService.AssignProrationPolicyResponse response = ffbc.ContractsService.assignProrationPolicy(request);

// The response can be checked for any errors
if(response.hasErrors())
{
    throw new Exception(response.getStringErrors());
}

// The response can be checked to ensure all contracts were updated
for(Id contractId : contractIds)
{
    System.assert(response.UpdatedContractIds.contains(contractId), 'Contract ' + contractId + ' was not updated.');
}

assignProrationPolicyAsync

global static Id assignProrationPolicyAsync(ffbc.ContractsService.AssignProrationPolicyRequest request)

Assigns a proration policy to contracts using a batch or queueable background process.

Input Parameters

Name Type Description
request ffbc.ContractsService.AssignProrationPolicyRequest Specifies the contracts and the proration policy to assign to them.

Return Value

The ID of the asynchronous process that is to update the contracts.

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.

/**
 * This sample shows how to use the ffbc.ContractsService.assignProrationPolicyAsync method to assign a proration
 * policy to a collection of contracts in bulk. This service will schedule an asynchronous job to iterate over
 * the provided contracts to enable volumes in excess of 10000 contracts to be updated with a new proration policy.
 */

//Given a collection of contract IDs and a proration policy ID
Set<Id> contractIds;
Id prorationPolicyId;

// Build a request object specifying the contract IDs that you want updated and the ID of the proration policy
// that you want to be applied to the contracts.
ffbc.ContractsService.AssignProrationPolicyRequest request = new ffbc.ContractsService.AssignProrationPolicyRequest();
request.ContractIds = contractIds;
request.ProrationPolicyId = prorationPolicyId;

// Send the request to the service and receive the ID of the AsyncApexJob that the contracts will be processed within
Id jobId = ffbc.ContractsService.assignProrationPolicyAsync(request);

// The job can then be selected from the AsyncApexJob table to inspect various details for example the status or the
// number of errors encountered. Keep in mind though that this is asynchronous, you won't see the job complete within
// the same execution context. The job may also start other jobs so the completion of this job may not mean that all
// the work is done - the system will send a notification when all the contracts have been updated. Background Process
// Settings control how you are notified.
AsyncApexJob job = [SELECT Status, NumberOfErrors, ExtendedStatus FROM AsyncApexJob WHERE ID = :jobId];

// If there are errors then you could throw an exception with a summary of the first error
if(job.NumberOfErrors > 0)
{
    throw new Exception(job.ExtendedStatus);
}

validateForAssignProrationPolicy

global static ffbc.Response validateForAssignProrationPolicy(ffbc.ContractsService.ValidateForAssignProrationRequest request)

Validates the contracts provided to determine if they can have a proration policy assigned.

Input Parameters

Name Type Description
request ffbc.ContractsService.ValidateForAssignProrationRequest Wrapper containing the IDs of the contacts being validated to have a proration policy assigned.

Return Value

A Response containing the IDs of contracts that could not be assigned a proration policy, and the errors that occurred.

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.

/**
 * This sample shows how to use the ffbc.ContractsService.validateForAssignProrationPolicy method to validate whether
 * a proration policy can be assigned to a collection of contracts in bulk. 
 */

//Given a collection of contract IDs
Set<Id> contractIds;

// Build a request object specifying the contract IDs that you want updated.
ffbc.ContractsService.ValidateForAssignProrationRequest request = new ffbc.ContractsService.ValidateForAssignProrationRequest();
request.ContractIds = contractIds;

// Send the request to the service and receive the response
ffbc.Response response = ffbc.ContractsService.validateForAssignProrationPolicy(request);

// The response can be checked for any errors
if(response.hasErrors())
{
    throw new Exception(response.getStringErrors());
}

// The response can be checked to ensure all contracts were valid for update.
for(Id contractId : contractIds)
{
    System.assert(!response.hasErrors(contractId), 'Contract ' + contractId + ' can not be updated.');
}

ffbc.ContractsService.Contract

global with sharing class Contract

Represents a Contract SObject including the contract line items and the relevant fields for creating, editing and viewing them.

Properties

Name Type Description
Id Id The ID of the Contract SObject being represented.
Name String The Name of the Contract SObject being represented.
Account Id The Account Id of the Contract SObject being represented.
ApprovalStatus String The Approval Status of the contract change request.
Description String The Description of the Contract SObject being represented.
FirstBillDate Date The First Bill Date of the Contract SObject being represented.
StartDate Date The Start Date of the Contract SObject being represented.
EndDate Date The End Date of the Contract SObject being represented.
RenewalReminder Date The Renewal Reminder of the Contract SObject being represented.
ContractName String The Contract Name of the Contract SObject being represented.
Status ffbc.ContractsService.Status Read only. The Status of the Contract SObject being represented.
CurrencyIsoCode String The CurrencyIsoCode of the Contract SObject being represented.
TotalContractValue Decimal The Total Value of the Contract SObject being represented.
LineItems List<ffbc.ContractsService.ContractLineItem> The Contract Line Items related to the Contract SObject being represented. See ContractLineItem for details of that object.
CompanyId Id The Company ID of the Contract SObject being represented.
ProrationPolicyId Id The policy by which to prorate this contract when it is billed. If set to null, partial periods are charged at full price.
ActiveContract Id Read only. The Active Contract ID of the Contract SObject being represented.
PreviousContract Id The Contract ID of the previous version of the Contract.
Type ffbc.ContractsService.Type Read only. The Type of the Contract SObject being represented.
OpenChangeRequest Id Read only. The ID of the open change request for this contract.
OpenRenewal Id Read only. The ID of the current draft renewal for this contract if it exists.
RenewalId Id Read only. The ID of the renewal for this contract if it exists.
SubmittedForApproval Boolean Read only. Indicates whether the Contract has ever been submitted for approval.
OriginalEndDate Date Read only. The Original End Date of the Contract SObject being represented.
ReasonForEndingContract String Read only. The ReasonForEndingContract of the Contract SObject being represented.
EndContractNotes String Read only. The EndContractNotes of the Contract SObject being represented.
CustomFields List<ffbc.CustomFieldsService.Field> The additional fields to be displayed on the enhanced Contract Detail page. The fields and their order are defined by the field set specified in the 'Enhanced Contract Field Set' setting of the Billing Central Settings custom setting. Read-only fields such as formulas, roll up summaries and system fields, as well as field paths which traverse related objects, are treated as read-only and should not be included in a call to save. When specifying custom fields from packages other than Billing Central, the namespace prefix must be included.
MajorVersion Integer The Major Version of the contract.

Methods

Contract

global Contract()

Constructs an empty Contract of type Contract. The LineItems list is initialised to an empty list.

addLineItem

global ffbc.ContractsService.Contract addLineItem(ffbc.ContractsService.ContractLineItem lineItem)

This method adds a ContractLineItem to the Contract and links that line to that Contract. If the ContractLineItem is null it is not added.

Input Parameters

Name Type Description
lineItem ffbc.ContractsService.ContractLineItem The ContractLineItem to be added the Contract.

Return Value

The Contract with the new contract line item added.

ffbc.ContractsService.ContractLineItem

global with sharing class ContractLineItem

Represents a Contract Line Item, including the fields required to create, edit and view contracts.

Properties

Name Type Description
Id Id The ID of the Contract Line Item SObject being represented.
Name String The Name of the Contract Line Item SObject being represented.
BillingTerm Id The Billing Term ID of the Contract Line Item SObject being represented.
BillingType ffbc.BillingService.BillingType The Billing Type of the Contract Line Item SObject being represented.
Description String The Description of the Contract Line Item SObject being represented.
Plan Id The Plan ID of the Contract Line Item SObject being represented.
PlanName String Read only. The Plan Name of the Contract Line Item SObject being represented.
PlanUrl String Read only. The URL pointing to the plan detail page.
ProductService Id The Product ID of the Contract Line Item SObject being represented.
Quantity Decimal The Quantity of the Contract Line Item SObject being represented.
InArrears Boolean The In Arrears status of the Contract Line Item SObject being represented.
SalesPrice Decimal The Sales Price of the Contract Line Item SObject being represented.
FirstBillDate Date The First Bill Date of the Contract Line Item SObject being represented.
StartDate Date The Start Date of the Contract Line Item SObject being represented.
EndDate Date The End Date of the Contract Line Item SObject being represented.
BilledTo Date The Billed To Date of the Contract Line Item SObject being represented.
Contract Id The Contract ID of the Contract Line Item SObject being represented.
UnitOfMeasure Id The Unit of Measure ID of the Contract Line Item SObject being represented.
UnitPrice Decimal The Unit Price of the Contract Line Item SObject being represented.
TotalBilled Decimal The Total Billed value of the Contract Line Item SObject being represented.
ProductName String Read only. The Name of the Product associated with the Contract Line Item SObject being represented.
ProductUrl String Read only. The URL pointing to the product detail page.
ActiveLine Id The Active Contract Line Item ID of the Contract Line Item SObject being represented.
PreviousContractLineItem Id The Contract Line Item ID of the previous version of the Contract Line Item.
PricingStructure ffbc.ContractsService.PricingStructure The Pricing Structure of the Contract Line Item SObject being represented.
TotalContractLineValue Decimal The Total Contract Value of the Contract Line Item SObject being represented.
RevenueCategory String The Revenue Category of the Contract Line Item SObject being represented.
SalesPriceOverride Decimal The SalesPriceOverride of the Contract Line Item SObject being represented.
Discount Id The Discount ID of the Contract Line Item SObject being represented.
CustomFields List<ffbc.CustomFieldsService.Field> The additional fields to be displayed on the enhanced Contract Detail page. The fields and their order are defined by the field set specified in the 'Enhanced Contract Line Field Set' setting of the Billing Central Settings custom setting. Read-only fields such as formulas, roll up summaries and system fields, as well as field paths which traverse related objects, are treated as read-only and should not be included in a call to save. When specifying custom fields from packages other than Billing Central, the namespace prefix must be included.

Methods

ContractLineItem

global ContractLineItem()

Constructs an empty ContractLineItem.

ffbc.ContractsService.BillingScheduleGenerationRequest

global with sharing abstract class BillingScheduleGenerationRequest

This class cannot be instantiated. It is used as an extension point by other request objects within the ContractsService.

Properties

Name Type Description
MonthsToGenerate Integer The number of future months for which to create billing schedules. If not provided, the default determined by the Billing Schedule Number of Months field of the Billing Central Settings custom setting is used. This must be a whole number from 0 to 99.

ffbc.ContractsService.ActivationRequest

global with sharing class ActivationRequest extends BillingScheduleGenerationRequest

This class wraps the criteria to be used when activating contracts.

This class extends ffbc.ContractsService.BillingScheduleGenerationRequest

Properties

Name Type Description
ContractIds Set<Id> A set containing the IDs of all contracts to be activated.

Methods

ActivationRequest

global ActivationRequest()

The default constructor for an ActivationRequest.

ffbc.ContractsService.ActivationResponse

global with sharing class ActivationResponse extends Response

The response to a request to activate contracts. This contains the errors for the contracts that cannot be activated.

This class extends ffbc.Response

ffbc.ContractsService.ApplyChangeRequestsRequest

global with sharing class ApplyChangeRequestsRequest extends BillingScheduleGenerationRequest

This class wraps the criteria to be used when applying change requests to contracts.

This class extends ffbc.ContractsService.BillingScheduleGenerationRequest

Properties

Name Type Description
ChangeRequestIds Set<Id> The IDs of the change requests to be applied.

Methods

ApplyChangeRequestsRequest

global ApplyChangeRequestsRequest()

The default constructor for an ApplyChangeRequestsRequest.

ffbc.ContractsService.ApplyChangeRequestsResponse

global with sharing class ApplyChangeRequestsResponse extends Response

The response to a request to apply change requests. This contains the errors for the change requests that could not be applied.

This class extends ffbc.Response

ffbc.ContractsService.CreateRenewalBaseRequest

global with sharing abstract class CreateRenewalBaseRequest

The base request object used by the createRenewals service. This contains the ContractIds to create renewals for and whether or not to extend the start, end and first bill dates on the renewal created.

Properties

Name Type Description
ContractIds Set<Id> A set containing the IDs of all contracts for which to create renewals.
RenewalLineDurationOption ffbc.ContractsService.RenewalLineDurationOption An enum that determines the options available to extend the start, end and first bill dates when renewing a contract.

ffbc.ContractsService.CreateRenewalRequest

global with sharing class CreateRenewalRequest extends CreateRenewalBaseRequest

A request object used by the createRenewals service. This request does not modify unit prices of associated lines and price breaks for the renewal.

This class extends ffbc.ContractsService.CreateRenewalBaseRequest

Methods

CreateRenewalRequest

global CreateRenewalRequest()

The default constructor for a CreateRenewalRequest.

ffbc.ContractsService.CreateRenewalWithPercentageAdjustmentRequest

global with sharing class CreateRenewalWithPercentageAdjustmentRequest extends CreateRenewalBaseRequest

A request object used by the createRenewals service. This request modifies unit prices of associated lines and price breaks by a percentage for the renewal.

This class extends ffbc.ContractsService.CreateRenewalBaseRequest

Properties

Name Type Description
PercentageAdjustment Decimal A decimal that determines how much the value of all unit prices is to be increased or decreased by.

Methods

CreateRenewalWithPercentageAdjustmentRequest

global CreateRenewalWithPercentageAdjustmentRequest()

The default constructor for a CreateRenewalWithPercentageAdjustmentRequest.

ffbc.ContractsService.CreateRenewalWithPricebookRequest

global with sharing class CreateRenewalWithPricebookRequest extends CreateRenewalBaseRequest

A request object used by the createRenewals service. This request modifies unit prices of associated lines and price breaks from a price book for the renewal.

This class extends ffbc.ContractsService.CreateRenewalBaseRequest

Properties

Name Type Description
PricebookId Id The ID of the price book from which to get the unit prices to be applied to the renewal.

Methods

CreateRenewalWithPricebookRequest

global CreateRenewalWithPricebookRequest()

The default constructor for an CreateRenewalWithPricebookRequest.

ffbc.ContractsService.CreateRenewalResponse

global with sharing class CreateRenewalResponse extends Response

The ffbc.Response object used by the createRenewals service. This contains the errors for the renewals that could not be created and a set containing the IDs of all the renewals created. This class cannot be instantiated.

This class extends ffbc.Response

Methods

getRenewalsCreated

global List<Id> getRenewalsCreated()

This method is used to access the list of renewals generated by the create response process.

Return Value

A list of IDs of the renewals created.

ffbc.ContractsService.ExpireRequest

global with sharing class ExpireRequest

The request object used by the Expire service. This contains the ContractIds to expire.

Properties

Name Type Description
ContractIds Set<Id> A set containing the ID of each contract to be expired.

Methods

ExpireRequest

global ExpireRequest()

The default constructor for an ExpireRequest.

ffbc.ContractsService.ExpireResponse

global with sharing class ExpireResponse extends Response

The ffbc.Response object used by the Expire service. This contains the errors for the contracts that could not be expired and a list containing the IDs of all the expired contracts. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
ExpiredContractIds List<Id> Read Only. A list of IDs of the contracts that were expired.

ffbc.ContractsService.ContractSummary

global with sharing class ContractSummary

This class wraps the fields that identify a contract.

Properties

Name Type Description
Id Id Read only. The ID of the Contract.
Name String Read only. The Name (Contract Number) of the Contract.
ContractName String Read only. The Contract Name of the Contract.

ffbc.ContractsService.ContractSummaryRequest

global with sharing class ContractSummaryRequest

A request object containing criteria for which to retrieve contracts.

Properties

Name Type Description
AccountIds Set<Id> The account IDs for which to include contract summaries.

Methods

ContractSummaryRequest

global ContractSummaryRequest()

The default constructor for this object.

ffbc.ContractsService.QuantityBreak

global with sharing class QuantityBreak

This class models a quantity break.

Properties

Name Type Description
Id Id Read only. The ID of the quantity break.
Quantity Decimal The quantity of the quantity break.
UnitPrice Decimal The unit price of the quantity break.

Methods

QuantityBreak

global QuantityBreak()

The default constructor for this object.

ffbc.ContractsService.PricingStructure

global with sharing class PricingStructure

This class models a pricing structure with quantity breaks.

Properties

Name Type Description
Id Id The ID of the pricing structure.
Description String The description of the pricing structure.
QuantityBreaks List<ffbc.ContractsService.QuantityBreak> The quantity breaks related to the pricing structure. The initial list of quantity breaks is ordered by ascending quantity.
PricingType ffbc.PricingStructuresService.Type The type of pricing to be used in billing.
UsageBillingType ffbc.PricingStructuresService.UsageBillingType The usage billing type to be used.

Methods

PricingStructure

global PricingStructure()

The default constructor for this object.

ffbc.ContractsService.ValidateForScheduleGenerationRequest

global with sharing class ValidateForScheduleGenerationRequest

A request object for the ValidateForScheduleGeneration method.

Properties

Name Type Description
Status String The status of the contract to be validated.
Type String The type of the contract to be validated.

Methods

ValidateForScheduleGenerationRequest

global ValidateForScheduleGenerationRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForTotalValueCalculationRequest

global with sharing class ValidateForTotalValueCalculationRequest

A request object for the ValidateForTotalValueCalculation method.

Properties

Name Type Description
DEPRECATED: The status of the contract to be validated.
Status
String
DEPRECATED: The end date of the contract to be validated.
EndDate
Date

Methods

ValidateForTotalValueCalculationRequest

The default constructor for this object.

global ValidateForTotalValueCalculationRequest()

ffbc.ContractsService.ValidateForFieldsCalculationRequest

global with sharing class ValidateForFieldsCalculationRequest

A request object for the ValidateForFieldsCalculation method.

Properties

Name Type Description
Status String The status of the contract to be validated.

Methods

ValidateForFieldsCalculationRequest

global ValidateForFieldsCalculationRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForCreatingBillingDocumentRequest

global with sharing class ValidateForCreatingBillingDocumentRequest

A request object for the ValidateForCreatingBillingDocument method.

Properties

Name Type Description
Status String The status of the contract to be validated.
Type String The type of the contract to be validated.

Methods

ValidateForCreatingBillingDocumentRequest

global ValidateForCreatingBillingDocumentRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForActivationRequest

global with sharing class ValidateForActivationRequest

A request object for the ValidateForActivation method.

Properties

Name Type Description
ContractIds Set<Id> The IDs of the Contracts to be validated.

Methods

ValidateForActivationRequest

global ValidateForActivationRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForAddPlanRequest

global with sharing class ValidateForAddPlanRequest

A request object for the ValidateForAddPlan method.

Properties

Name Type Description
Status String The status of the contract to be validated.

Methods

ValidateForAddPlanRequest

global ValidateForAddPlanRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForEndingRequest

global with sharing class ValidateForEndingRequest

A request object for the ValidateForEnding method.

Properties

Name Type Description
Status String The status of the contract to be validated.
Type String The type of the contract to be validated.

Methods

ValidateForEndingRequest

global ValidateForEndingRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForCreatingRenewalRequest

global with sharing class ValidateForCreatingRenewalRequest

A request object for the ValidateCreatingRenewal method.

Properties

Name Type Description
Id Id The ID of the contract to be validated.
Status ffbc.ContractsService.Status The status of the contract to be validated.
Type ffbc.ContractsService.Type The type of the contract to be validated.
EndDate Date The end date of the contract to be validated.

Methods

ValidateForCreatingRenewalRequest

global ValidateForCreatingRenewalRequest()

The default constructor for this object.

ffbc.ContractsService.ValidateForAssignProrationRequest

global with sharing class ValidateForAssignProrationRequest

A request object for the validateForAssignProration method.

Properties

Name Type Description
ContractIds Set<Id> The IDs of the contracts to be validated for having a proration policy assigned.

Methods

ValidateForAssignProrationRequest

global ValidateForAssignProrationRequest()

The default constructor for this object.

ffbc.ContractsService.EndingParameter

global with sharing class EndingParameter

This class holds the parameters for the ending a contract early.

Properties

Name Type Description
Reason String The reason for ending the contract.
Notes String Additional notes about the reason for ending the contract early.
NewEndDate Date The new date on which the contract is to end.

Methods

EndingParameter

global EndingParameter()

The default constructor for this object.

ffbc.ContractsService.EndingResponse

global with sharing class EndingResponse extends Response

The ffbc.Response object used by the Ending service. This contains the errors for the contracts that could not be ended and a list containing the IDs of all contracts that were ended. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
ContractsEnded List<Id> Read only. The list of contracts that were ended.

ffbc.ContractsService.CalculateFieldsRequest

global with sharing class CalculateFieldsRequest

This class holds the parameters to calculate the values of the contract.

Properties

Name Type Description
ContractIds Set<Id> The set of contract ids to calculate for.

Methods

CalculateFieldsRequest

global CalculateFieldsRequest()

The default constructor for this object.

ffbc.ContractsService.CalculateFieldsResponse

global with sharing class CalculateFieldsResponse extends Response

The ffbc.Response object used by the Calculate fields service. This contains the errors for the contract fields calculation. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
UpdatedContracts List<ffbc__Contract__c> The list of contracts that have been updated by the calculation.
UpdatedLineItems List<ffbc__ContractLineItem__c> The list of contract line items that have been updated by the calculation.

ffbc.ContractsService.CalculateFieldsWithoutSaveRequest

global with sharing class CalculateFieldsWithoutSaveRequest

This class holds a list of contracts to have their fields calculated.

Properties

Name Type Description
Contracts List<ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderRequest> The lines to calculate.

Methods

CalculateFieldsWithoutSaveRequest

global CalculateFieldsWithoutSaveRequest()

ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderRequest

global with sharing class CalculateFieldsWithoutSaveHeaderRequest

This class holds the list of lines for a contract, and contract information used to calculate fields.

Properties

Name Type Description
Lines List<ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest> The lines to calculate
EndDate Date The End Date of the contract to calculate.
ProrationPolicyId Id The Proration Policy of the contract to calculate.
Identifier Id The unique identifier of the contract to calculate.

Methods

CalculateFieldsWithoutSaveHeaderRequest

global CalculateFieldsWithoutSaveHeaderRequest()

ffbc.ContractsService.CalculateFieldsWithoutSaveLineRequest

global with sharing class CalculateFieldsWithoutSaveLineRequest

This class holds the parameters to calculate the values of the contract line and header.

Properties

Name Type Description
QuantityBreaks List<ffbc.ContractsService.QuantityBreak> The related Quantity Breaks of the Contract Line Item to calculate.
Quantity Decimal The Quantity of the Contract Line Item to calculate.
UnitPrice Decimal The Unit Price of the Contract Line Item to calculate.
PricingType ffbc.PricingStructuresService.Type The Pricing Type of the Contract Line Item to calculate.
BillingTerm Id The ID of the Billing Term of the Contract Line Item to calculate.
StartDate Date The Start Date of the Contract Line Item to calculate.
EndDate Date The End Date of the Contract Line Item to calculate.
BillingType ffbc.BillingService.BillingType The Billing Type of the Contract Line Item to calculate.
Discount Id The Discount ID of the Contract Line Item to calculate.
Identifier String The unique identifier of the line to calculate.

Methods

CalculateFieldsWithoutSaveLineRequest

global CalculateFieldsWithoutSaveLineRequest()

The default constructor for this object.

ffbc.ContractsService.CalculateFieldsWithoutSaveResponse

global with sharing class CalculateFieldsWithoutSaveResponse extends Response

The ffbc.Response object used by the Calculate values service. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
Contracts List<ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderResponse> The contracts being calculated.

ffbc.ContractsService.CalculateFieldsWithoutSaveHeaderResponse

global with sharing class CalculateFieldsWithoutSaveHeaderResponse extends Response

The ffbc.Response object used for Contract headers by the Calculate values service. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
Lines List<ffbc.ContractsService.CalculateFieldsWithoutSaveLineResponse> The lines being calculated.
TotalContractValue Decimal The Total Value of the Contract SObject being represented.
Identifier Id The unique identifier of the contract being calculated.

ffbc.ContractsService.CalculateFieldsWithoutSaveLineResponse

global with sharing class CalculateFieldsWithoutSaveLineResponse extends Response

The ffbc.Response object used for lines by the Calculate values service. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
SalesPriceOverride Decimal The SalesPriceOverride of the Contract Line Item SObject being represented.
TotalContractLineValue Decimal The Total Contract Value of the Contract Line Item SObject being represented.
Identifier String The unique identifier of the line being calculated.

ffbc.ContractsService.AssignProrationPolicyRequest

global with sharing class AssignProrationPolicyRequest

This class holds the parameters to assign a proration policy to multiple contracts.

Properties

Name Type Description
ContractIds Set<Id> The IDs of the contracts that the proration policy will be assigned to.
ProrationPolicyId String The unique identifier of the proration policy to assign.

Methods

AssignProrationPolicyRequest

global AssignProrationPolicyRequest()

The default constructor for this object.

ffbc.ContractsService.AssignProrationPolicyResponse

global with sharing class AssignProrationPolicyResponse extends Response

The ffbc.Response object used by the Assign Proration Policy service. This contains any errors produced by the proration policy assignment. This class cannot be instantiated.

This class extends ffbc.Response

Properties

Name Type Description
UpdatedContractIds Set<Id> The IDs of the contracts that the proration policy was assigned to.
© Copyright 2009–2018 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.