Schedulable Batch Classes to send and track invoices
Two scheduled Apex batch jobs keep e-invoices flowing to Ecosio: one sends invoices out, the other tracks their delivery status. Both should be scheduled to run automatically and require no ongoing maintenance once set up.
EcosioInvoiceDepositBatch — sends invoices to Ecosio
Picks up any invoice that is ready to be deposited (or that previously failed) and submits it to Ecosio. Newly generated invoices won't reach Ecosio until this job runs.
EcosioInvoiceStatusBatch — tracks invoice delivery status
Checks in with Ecosio on every invoice that's already been sent but hasn't reached a final "delivered" state yet, and updates its status in Salesforce accordingly (e.g. from "Sent" to "Success", or to "Error" if it was rejected).
How to schedule them
1. Go to Setup → Apex Classes.
2. Click Schedule Apex.
3. Give the job a name (e.g. "Ecosio - Send invoices"), pick a frequency, and select EcosioInvoiceDepositBatch as the Apex class. Save.
4. Repeat the same steps for EcosioInvoiceStatusBatch (e.g. "Ecosio - Track invoice status").
Suggested frequency: daily for both is a safe default. If you send a high volume of invoices, you can schedule the status batch more frequently than the deposit batch, since delivery confirmation from the network can take a little longer than submission.
What to expect
After each run, the user who scheduled the job receives a Salesforce notification summarizing the outcome. If any invoices failed to send or update, that user also receives an email with the details of each failure so it can be investigated.