---
title: "Configuring an integration with AV"
canonical: "https://help.fieldbuddy.com/space/FBDOCS/2078310854/Configuring%20an%20integration%20with%20AV"
format: markdown
---
### How to configure FieldBuddy Connect for AccountView

##### Remarks

- Currenly only inbound sync is possible.
- Only upsert, update & insert operation is possible.

##### AccountView basics

- Each object has a name and corresponding object name & base. Object 'Debiteuren' has the object name 'AR1' and base 'CONTACT'. Base is the prefix for all fields. If Base is empty, the value of 'Table' is used as prefix.
- Each field has a field name written as prefix.fieldName. 'Debiteurnummer' on 'Debiteuren' can be called on by 'CONTACT.SUB_NR'.
- Each object has a field with an unique Id number. The name of this field differs.
- Different objects are linked to each other by a separate object/table.

### Configuration steps

##### Create AccountView API application

1. Login at [https://www.accountview.net/](https://www.accountview.net/) > Menu (3-bar icon) > Developer > Add application. Use for:

- Redirect URI: https://login.salesforce.com/apex/FBCONNECT__AuthCallback
- Website URI: https://login.salesforce.com/apex/FBCONNECT__AuthCallback

##### Create new Service Provider

- Provider Name (e.g. 'AccountView')
- Provider Type: 'AV'
- Protocol: 'REST'
- Schedule Job Interval: fill with Cron expression
- Auth Endpoint URL: [https://www.accountview.net/ams/authorize.aspx](https://www.accountview.net/ams/authorize.aspx)
- API Endpoint URL: [https://www.accountview.net/api/v3](https://www.accountview.net/api/v3)
- Redirect URL: https://login.salesforce.com/apex/FBCONNECT__AuthCallback
- Client Id: Value of 'API-sleutel' from [https://www.accountview.net/](https://www.accountview.net/) > Menu (3-bar icon) > Developer > Applications > Your application. **Please note**: This id should not be encrypted.
- Client Secret: Value 'API-secret' from [https://www.accountview.net/](https://www.accountview.net/) > Menu (3-bar icon) > Developer > Applications > Your application. **Please note**: This secret should not be encrypted.
- X-Company Id: Value of 'X-Company id' in box 'Header' at bottom of page. Found on:  [https://www.accountview.net/](https://www.accountview.net/) > Menu (3-bar icon) > Developer > API Builder > Create some random Get-request and your 'X-Company id' will be in the header box.

![image](media://UNKNOWN_MEDIA_ID)

##### Create new Service User

- On the just created Service Provider, press 'Authorize User'. Login at AccountView to authorize your Salesforce application.
- Tick 'Is organisation primary user'

##### Create External Id Fields on affected Objects

- Create fields on Internal SF Objects to store external AV Id in. For example: Create External_Field__c on Account.

##### Create a relationshop object

For example: To connect Accounts to Contacts and vice versa, you could create an object 'Account Contact Link'.

Make fields for:

- External Id for the Id of the relationship record. In our example we used 'External Id'
- Id field for Id of linked object 1: In our example we used 'Sub Nr', named after the Id field name of Accounts.
- Id field for Id of linked object 2: In our example we used 'PP Code', named after the Id field name of Contacts.
- Master-Detail relationship field with object 1. In our example Account. On Master-Detail fields the following must be checked: Allow reparenting - Child records can be reparented to other parent records after they are created.
- Master-Detail relationshop field with object 2. In our example Contact. On Master-Detail fields the following must be checked: Allow reparenting - Child records can be reparented to other parent records after they are created.

##### Creating Object Mappings

- Service Provider: Select the correct Service Provider for AccountView.
- Maximum Page Requests: maximum amount of API calls that will be made. If null, value is set to 999.
- Objects Per Page Request: amount of objects to request per API call. Value must be between 0 and 1000. If null, value is set to 1000.
- Sync Direction: Only inbound sync is available at the moment.
- Operation Type: Only insert, update and upsert operation is available at the moment.
- Execution Order: Fill in with number. When syncing, API Calls with the Object Mappings will be sorted on according the numbers set on the individual Object Mappings.
- Filter Criteria: Up to 4 filters may be added. Go to the AccountView API Builder, fill in all requested fields and copy the 'filter' part from the example URL (example: '&FilterControlSource1=PROF_ID&FilterOperator1=Equal&FilterValueType1=C&FilterValue1=1&FilterIsListOfValues1=false')
- Is Active: Determines if this object mapping will be used during sync.
- Use Last Successful Sync DateTime. Tick to limit API calls to include only objects with a last changed date after the Last Successful Sync DateTime.
- Internal Object: Internal SF Object to write the External record to.
- Internal field for external Id: Field on the internal Object where the external AV Id is stored in.
- External Object: External AV object name.
- External Field Prefix: External AV base or table if base not present.
- External Id Field: Field on the External AV Object where the AV Id is stored.

##### Creating Field Mappings

→ The Id field does not have to be added in the Field Mapping, this value is requested and filled in the correct field automatically.

- Object Mapping: Fill in the object mapping to which this field is related.
- Is Required: Tick if you are using this Field Mapping to make a relationshop/link between records.
- Linking fields: See below
- Internal Field: Field name on the Internal SF Object where the value must be inserted.
- External Field: Field name on the external AV Object that holds the value.

##### Creating a relationship with Field Mappings

→ To create a relationship, 2 field Mappings must be created.

- Tick 'Is required'.
- Linked Internal Object: API Name the SF object that must be linked to the relationship object. (example: Contact).
- Linked Internal Object External Id Field: Field name on the Linked Internal Object where the External AV id is stored.
- Internal Link Field: Master-Detail relationship field on the relationship object where the Id of the linked Object (e.g. Contact) will be stored.

### Example setup

→ Objective: We want AccountView Accounts (debiteuren), Contacts and their internal relationships to be synced to SalesForce. In this exampe we only request and save the Name of the object (Name on Account, or Last Name on Contact).

##### AccountView Structure

<u>Accounts ('Debiteuren')</u>

- Object: AR1.
- Base: CONTACT.
- Id Field: SUB_NR.
- Name Field: ACCT_NAME.

<u>Contacts ('Contactpersonen')</u>

- Object: PP1.
- Base: PEOPLE.
- Id Field: PP_CODE.
- Name Field: LST_NAME.

<u>Linking object ('Contactpersoonfuncties bij bedrijven')</u>

- Object: LNCP.
- Base: CON_PP.
- Id Field: REC_ID.
- Id Field for Account: SUB_NR.
- Id Field for Contact: PP_CODE.

##### Step by step

- We created an AccountView API application, a Service Provider and a Service User.
- On Account and Contact, we created a custom field called 'External_Id__c'.
- For the relationship, we created an object 'Account To Contact Link' with fields 'External Id', 'Sub nr', 'PP Code', 'Account' (master-detail), 'Contact' (master-detail).
- We created 3 Object Mappings for: Account, Contact & Account To Contact Link:

![image](media://UNKNOWN_MEDIA_ID)

![image](media://UNKNOWN_MEDIA_ID)


![image](media://UNKNOWN_MEDIA_ID)

- For Account we created a Field Mapping 'AccountName'

![image](media://UNKNOWN_MEDIA_ID)

- For Contact we created a Field Mapping 'ContactLastName'

![image](media://UNKNOWN_MEDIA_ID)

- For Account To Contact Link we created a Field Mapping for 'AccountLink' and 'ContactLink', both with 'Is Required' checked and the linking fields filled.

![image](media://UNKNOWN_MEDIA_ID)

![image](media://UNKNOWN_MEDIA_ID)

- Ready to sync!