Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 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 about creating invoices using APEX (note: this is an ADvendio internal link which will not be available to external viewers).

Create Invoices (using APEX)

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

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


Info
titleAccounting

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<StringObject> paramaters = new Map<StringObject>();
    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.
  }
}