> For the complete documentation index, see [llms.txt](https://docs.mydbsync.com/cloud-workflow/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mydbsync.com/cloud-workflow/tutorials/salesforce-and-quickbooks/account-hierarchy-in-salesforce-and-quickbooks.md).

# Account Hierarchy in Salesforce and QuickBooks

## I**ntegrating objects from Salesforce to QuickBooks**

* If QuickBooks Customer and Salesforce Account object has hierarchy structures enabled, then the following changes have to be implemented within your DBSync mappings/template to facilitate hierarchy mappings.
* Let's say Avankia & DBSync are Parent & Child accounts, respectively, in Salesforce. Also, Avankia & DBSync are the Customer & Job in QuickBooks, respectively.
* The default mappings within the DBSync standard template integrate the above Salesforce Account records as two separate Customer records—" Avankia" and "DBSync"—as opposed to Parent and child records.
* Login to DBSync accounts with user credentials to make changes or create hierarchy mappings. Once the user has logged into their DBSync account, click on the *Development Studio to go to the* DBSync Project page and navigate to the flow page from the DBSync Task.
* Drag and drop a new flow action and enter the name **AccountToCustomer2** and Save.
* After Creating the flow '**AccountToCustomer2'**, move this next to the '**AccountToCustomer'** flow.
* Configure the '**AccountToCustomer2'** flow to add query and Transform\&write properties from the '**AccountToCustomer'** workflow.
* Once all the properties are filled, copy all the mappings from the '**AccountToCustomer'** mapping page.
* Once the mappings are completed, add the following changes in the "Mapping page".

```
Target == "CustomerAddRq/CustomerAdd/ParentRef/FullName"
```

```
Source Field == "VALUE("Parent/Name")"
```

* Now use the following query in '**AccountToCustomer2'** Trigger using Advanced Query Builder.

```
select {!.} from Account where AVSFQB__QuickBooks_Id__c = '' and Parent.Name!='' 
```

* Similarly, replace '**AccountToCustomer'** query with the query below:

```
 select {!.} from Account where AVSFQB__QuickBooks_Id__c = '' and Parent.Name ='' 
```

Once the user is done with all the above-mentioned changes, then "initiate the integration through web connector". Data will be integrated into QuickBooks with their respective hierarchies in place as shown below.

<figure><img src="/files/fFUhSgNS4uvNqUm95nHA" alt=""><figcaption></figcaption></figure>

This concludes Account hierarchy mappings for the data-flow from Salesforce into QuickBooks.
