Professional Services Automation Apex API Developer Reference

pse.BillingDocumentService

global with sharing class BillingDocumentService

Methods

BillingDocumentService

global BillingDocumentService()

validateBillingEvents

global static Map<ID, String> validateBillingEvents(pse.BillingDocumentService.CreateBillingDocumentRequest integrationRequest)

Validate billing events for billing document creation. Return any invalid billing events in a map with the relevant error message.

Input Parameters

Name Type Description
integrationRequest pse.BillingDocumentService.CreateBillingDocumentRequest Structure containing the IDs of billing events to be validated.

Return Value

This method returns a map containing the IDs of invalid billing events with their validation error messages. If all the billing events are valid, this method returns an empty map.

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.

Set<Id> billingEventIds; //The IDs of the billing events to use
BillingDocumentService.CreateBillingDocumentRequest integrationRequest = new BillingDocumentService.CreateBillingDocumentRequest(billingEventIds);
Map<Id, String> validationErrors = BillingDocumentService.validateBillingEvents(integrationRequest);

create

global static List<ID> create(pse.BillingDocumentService.CreateBillingDocumentRequest integrationRequest)

This method creates billing documents for specified billing events synchronously.

Input Parameters

Name Type Description
integrationRequest pse.BillingDocumentService.CreateBillingDocumentRequest Structure containing the IDs of billing events that billing documents will be created for.

Return Value

This method returns a List of billing document IDs that were created for the specified billing events.

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.

Set<Id> billingEventIds; //The IDs of the eligible billing events to use
BillingDocumentService.CreateBillingDocumentRequest integrationRequest = new BillingDocumentService.CreateBillingDocumentRequest(billingEventIds);
List<Id> billingDocumentList = BillingDocumentService.create(integrationRequest);

createAsync

global static Set<ID> createAsync(pse.BillingDocumentService.CreateBillingDocumentRequest integrationRequest)

This method creates billing documents for specified billing events asynchronously.

Input Parameters

Name Type Description
integrationRequest pse.BillingDocumentService.CreateBillingDocumentRequest Structure containing the IDs of billing events that billing documents will be created for.

Return Value

This method returns the IDs of the batch jobs that will create the billing documents.

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.

Set<Id> billingEventIds; //The IDs of the eligible billing events to use
BillingDocumentService.CreateBillingDocumentRequest integrationRequest = new BillingDocumentService.CreateBillingDocumentRequest(billingEventIds);
Set<Id> apexJobIdSet = BillingDocumentService.createAsync(integrationRequest);

pse.BillingDocumentService.CreateBillingDocumentRequest

global inherited sharing class CreateBillingDocumentRequest

A structure containing the criteria on which to generate billing documents from billing events.

Properties

Name Type Description
BillingEventIds Set<ID> Set of billing event IDs.

Methods

CreateBillingDocumentRequest

global CreateBillingDocumentRequest(Set<ID> BillingEventIds)

CreateBillingDocumentRequest

global CreateBillingDocumentRequest()

© Copyright 2009–2024 Certinia Inc. All rights reserved. Various trademarks held by their respective owners.