6.2.6 Advanced Scheduling Billing Run

It is now possible to carry out advanced scheduling of the Billing Run using APEX which will run the batch job and create Invoices for Media Campaigns based on certain pre-defined criteria in the APEX code. Through the use of this method, the customer can build their own scheduler to execute the ADvendio Billing Run Process. 

To find out more, please talk to your Account Manager.

Create Invoices (using APEX)

The global class ADvendio.InvoiceBillingBatch can be used to start a batch job that will create Invoices for Media Campaigns. 

Through the use of this method, the customer can build their own scheduler to execute the ADvendio Billing Run Process. 



Accounting

Please take note that this is currently not supported for Accounting customers because setting an Accounting Period is not possible.

Sample pseudo code:

public class ExampleBillingProcessSchedule implements System.Schedulable { public void execute(SchedulableContext sc) { // Build a string containing all Ids of invoices being considered, // IDs are to seperate by comma. String recordIds = ...; // Prepare data, execute ADvendio Billing Run process. Map<String, Object> paramaters = new Map<String, Object>();     paramaters.put('RecordIds', recordIds); String result = ADvendio.WebServiceCenter.run('ExecuteBillingRun', JSON.serialize(paramaters)); // result is a JSON, contains following attributes: // Status, Messages // whereby Message is optional, value for it is error message. // Possible values for Status are: Queued, Failed.   } }