Usage Report Records

One of the most powerful features of Amberflo is Usage Analytics. Amberflo extends this feature to its Salesforce managed app.

Sync job

The application includes a sync job AFLO.UsageRecordDownloadScheduler which can be scheduled to import usage records from Amberflo. These usage records can be leveraged for reporting purposes in Salesforce. For each customer, usage is loaded by aggregating the values of the meter into a daily bucket.

The sync job can be scheduled to run daily. Every time the job runs, it fetches usage records from Amberflo with start date greater than the latest end date value in Salesforce. This way only the delta is synced between the two systems instead of bringing in all usage records.

Data schema

Usage report records are maintained as a custom object: UsageRecord. These records are related to the Amberflo customer object.

meterLabelMeter label as displayed in Amberflo.
totalValueThe daily aggregated value for the meter and customer.
meterApiNameMeter API name as defined in Amberflo.
customerIdcustomerId that references the Amberflo customer custom object.
Start DateStart of the daily aggregation bucket. The bucket is a day that starts at midnight UTC.
End DateEnd of the daily aggregation bucket. The end marker is midnight UTC of the next day. Note this value will be used as a starting point to import records the next time the job runs.

Scheduling instructions

  • Go to Setup
  • Type "Apex"
  • Select Apex Classes
  • Click on the button Schedule Apex
  • Enter the Job Name
  • Select "UsageRecordDownloadScheduler" as Apex Class
  • Set your schedule - we recommend to run daily at UTC midnight + 6 hrs


The job can also be run on demand from the Developer Console:

(new AFLO.UsageRecordDownloadScheduler()).execute(null);