Logo

How can we help you?

Search our knowledge base to get answers to your questions, access video training & more!

Schedulable Exchange Rate Sync

Apphesive

Schedulable Exchange Rate Sync

To keep exchange rates accurate and up to date, they need to be regularly synced between QuickBooks and Salesforce. Automating this process helps eliminate manual updates and reduces the risk of inconsistencies.

Last updated on 04 May, 2026

Before setting up the scheduled sync, make sure you are using the latest version of Apphesive:

Apphesive v8.6: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1K000002QFDT

Overview

The ExchangeRateRetrieverBatch class is responsible for:

  • Fetching the latest exchange rates from QuickBooks.

  • Updating corresponding records in Salesforce.

  • Running automatically on a defined schedule.

This eliminates the need for manual updates and ensures consistency across integrations.

Scheduling the Job

You can schedule the exchange rate sync using Salesforce Execute Anonymous window.

Sync for All QuickBooks Accounts
To run the synchronization daily at 6:00 AM:

JavaScriptString cron = '0 0  6  * * ?' ;
System.schedule('Exchange Rate Sync Batch', cron, new fw8.ExchangeRateRetrieverBatch());

Sync for a Specific QuickBooks Account
If you need to limit the sync to a single QuickBooks connection, pass the connection ID when scheduling:

JavaScriptString cron = '0 0  6  * * ?' ;
System.schedule('Exchange Rate Sync Batch', cron, new fw8.ExchangeRateRetrieverBatch(<your quickbooks connection Id>));

Cron Expression Explained

The cron expression used:

JavaScript0 0 6 * * ?

Represents:

  • 0 seconds

  • 0 minutes

  • 6 hours (6:00 AM)

  • * every day of the month

  • * every month

  • ? no specific day of the week

Alternative Way to Schedule the Job

If you prefer, you can schedule the job directly through Salesforce without using code.

  1. Go to Setup

  2. In the Quick Find box, search for Apex Classes

  3. Select Schedule Apex

  4. In the Apex Class field, search for and select ExchangeRateRetrieverBatch

image.png
  1. Choose your desired frequency and timing

  2. Click Save.

Monitoring and Validation

After scheduling the job:

  • Navigate to Setup > Scheduled Jobs to confirm it has been created.

  • Check Apex Jobs for execution status and any failures.

  • Review logs if exchange rates are not updating as expected.

Best Practices

  • Schedule the job during off-peak hours (e.g., early morning) to reduce system load.

  • Validate QuickBooks connection IDs before scheduling targeted runs.

  • Avoid creating duplicate scheduled jobs.

  • Periodically review job history to ensure consistent performance.

Did you find this article helpful?
Previous

Credit Memo Class Reference

Next