# Multiple Price Levels in Salesforce QuickBooks Integration

Multiple Price Levels of QuickBooks can be integrated with the respective Salesforce Price Books using DBSync. This section explains the steps involved in DBSync customization for multiple Price Level Integration.

## **Customization Steps** <a href="#mulitplepricelevelsinsalesforcequickbooksintegration-customizationsteps" id="mulitplepricelevelsinsalesforcequickbooksintegration-customizationsteps"></a>

Let's consider integrating two QuickBooks Price Levels, *PriceLevel1* & *PriceLevel2,* with Salesforce Price Books. To start, two Salesforce Price Books - *PriceBook1* & *PriceBook2* - should be created.&#x20;

The following process will sync the items of QuickBooks, *PriceLevel1* & *PriceLevel2*, with Salesforce Price Books, *PriceBook1* & *PriceBook2*, respectively.

1. Log in to the DBSync account using your credentials.&#x20;
2. Navigate to DBSync Project QuickBooks Desktop to Salesforce Accounts Receivable.
3. Navigate to Apps. Ensure that Salesforce Connector is validated and QuickBooks Web Connector is configured.
4. Go to the Automated Tas&#x6B;**.** You will see a list of flows.&#x20;
5. Create a new flow *PriceLevelToProduct2* and move this between the Product and Opportunity sync flow.
6. In this new workflow, add the following query using **Advanced Query Builder**. The data source should be QuickBooks. The batch size in properties will remain as *100* (default value).

```
 select * from PriceLevel where Pricelevel.Maxreturned=100
```

* In the Transform\&Write section, select **Target** as Salesforce, **Operation** as Update, **Target Object** as Product2, and click **Map**.
* Map the fields as shown below. Then, **Save**.&#x20;

Notice that on the left side, it has **Target** fields (Salesforce), and on the right side, it has **Source** fields (QuickBooks). *PriceBook1* is the name of the Salesforce PriceBook, and *PriceLevel1* is the name of the QuickBooks Price Level.

```
Process Records When = IF(EQUALS(VALUE("Name"),"PriceLevel1"),"true","false")
Product2 = Loop Over "PriceLevelPerItemRet"
Quickbooks_Id__c = VALUE("ItemRef/ListId")
Name = VALUE("ItemRef/FullName")
Pricebook2Id = "PriceBook1"
UnitPrice = VALUE("CustomPrice")
```

* In the Transform\&write action, select **Target** as Salesforce, **Operation** as Update, **Target Object** as *Product2*, and click **Map**.
* Map the fields as shown below. Then, **Save**.&#x20;
* Notice that on the left side, it has Target fields (Salesforce), and on the right side it has **Source** fields (QuickBooks). *PriceBook2* is the name of Salesforce PriceBook, and *PriceLevel2* is the name of the QuickBooks Price Level.

```
Process Records When = IF(EQUALS(VALUE("Name"),"PriceLevel2"),"true","false")
Product2 = Loop Over "PriceLevelPerItemRet"
Quickbooks_Id__c = VALUE("ItemRef/ListId")
Name = VALUE("ItemRef/FullName")
Pricebook2Id = "PriceBook2"
UnitPrice = VALUE("CustomPrice")
```

* To sync the new QuickBooks Price Level, repeat the above process. For every price level in QuickBooks, create a new Rule and map as discussed above.
