# Recurring Transactions to Accounting System

## Overview

When an existing transaction - like Invoice or sales order - is updated with new transaction details, such transactions are termed as Recurring Transaction. This module explains a step-by-step process involved while integrating DBSync with Salesforce Opportunities as Recurring Transactions into accounting systems like QuickBooks and Great Plains.

Most of the steps are involved with Salesforce - like *enabling schedules for opportunity line items, installing DBSync Recurring Transactions Package and, scheduling an apex class*. After making all the necessary changes in Salesforce, *DBSync must be enabled with Recurring Transactions mapping* to run an integration. This will successfully sync Salesforce Opportunity as Recurring Transaction into Accounting System.

### **Key Benefits**

Integrate Salesforce Opportunity as Recurring Transactions into Accounting System.

### **Requirement**

* Salesforce Adapter
* QuickBooks Adapter
* Great Plains Adapter.

#### **Provider**

DBSync for QuickBooks/Great Plains.&#x20;

### Enable Schedules for Opportunity line Items in Salesforce <a href="#recurringtransactionstoaccountingsystem-enableschedulesforopportunitylineitemsinsalesforce" id="recurringtransactionstoaccountingsystem-enableschedulesforopportunitylineitemsinsalesforce"></a>

1. *Login* to Salesforce using *admin* credentials.
2. Go to **user menu** **> Setup** **> Customize** **> Products** **> Schedule Setup.**
3. Enable the ability to create schedules on Products by *enabling Quantity and Revenue Schedules* as shown in the image below.
4. Go to **User menu** **> Opportunities** **> Page Layouts** **>** Drag **'IsRecurring'** and **'Next Sync On'** to **DBSync section** **> Save the changes.**

### Install DBSync Recurring Transactions Package in Salesforce <a href="#recurringtransactionstoaccountingsystem-installdbsyncrecurringtransactionspackageinsalesforce" id="recurringtransactionstoaccountingsystem-installdbsyncrecurringtransactionspackageinsalesforce"></a>

1. Use the URL mentioned below to login to access *Salesforce Package Installation details*.
2. *Login* to Salesforce using *Admin* credentials. *Package Installation Details* will be displayed. Click on *continue* to proceed.
3. *Approve Package API Access* and then click ***Next.***
4. *Security level* must be selected to *grant access. Click* *Next* to proceed.
5. The package is ready to be installed. Click Install to *install*.
6. *Install complete* message will be displayed. This will confirm that DBSync Recurring Transactions package is installed.

### Schedule an Apex Class in Salesforce <a href="#recurringtransactionstoaccountingsystem-scheduleanapexclassinsalesforce" id="recurringtransactionstoaccountingsystem-scheduleanapexclassinsalesforce"></a>

1. Go to *Username* **>** *Develop* **>** *Apex Classes* **>** *Schedule* *Apex* to implement the schedule able interface to be automatically executed on a weekly or monthly interval.
2. Enter the record details as mentioned below and click **Save**.
3. Job Name **>** *Recurring Transactions.*
4. Apex Class **>** select the class *DBSyncProductSchedule.*
5. Select *Weekly* Frequency and select all the days. As a result, the Schedule will run every day. Next, set your Opportunity to sync with your Accounting System when it syncs using DBSync.
6. Set the Start and End Date as per the requirement. Set the *"Preferred Start Time"* as 1 AM.
7. **Save** the record.
8. To ensure the schedule is set and is in the Queue, go to **User menu** **>** *Setup* **>** *Administration Setup* **>** *Monitoring* **>** *Scheduled* *Jobs*. You will see the schedule listed on the page.

{% hint style="info" %}
**NOTE:** Administrator Rights are required to perform the above steps.&#x20;
{% endhint %}

### Enable Recurring Transactions Mapping in DBSync <a href="#recurringtransactionstoaccountingsystem-enablerecurringtransactionsmappingindbsync" id="recurringtransactionstoaccountingsystem-enablerecurringtransactionsmappingindbsync"></a>

* Login to DBSync to access DBSync Mapping. To know about DBSync Mapping in detail, please refer to all sections under Platform of DBSync wiki by checking DBSync iPaaS.
* Enable mapping for the required transaction and save the mapping before running the integration.

### Pre-requisites <a href="#recurringtransactionstoaccountingsystem-pre-requisites" id="recurringtransactionstoaccountingsystem-pre-requisites"></a>

It is also necessary that the Salesforce Opportunity is created with the right parameters to sync Recurring Transactions into Accounting Systems.

* Items with Schedules, for the date specified in Next Sync On, will be pushed in your transactions in the Accounting System. Line Items without schedules will not be pushed into your Accounting System.
* If you want to remove the recurring feature for an Opportunity, then **uncheck** the field "IsRecurring" in the Opportunity.
