Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow these steps to set up the Exact Online integration between GoMeddo subscription management and Exact Online.

1. Create a Connected app in Exact Online.

Use the following steps to create a connected app in Exact Onlinehttps://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Process-appcenter-eol-appcenter-dev-registerapp-p. When creating a new connected app, set the Redirect URI to a mock value, like https://www.gomeddo.com .

2. Create an Auth. Provider in Salesforce.

In Setup, navigate to Identity -> Auth. Providers and click “New”. Create an Auth. Provider with the following settings. The values for Consumer Key and Consumer Secret should be copied from the fields Client ID and Client Secret of Connected app that was created in the first step.

...

After the Auth. Provider is saved, copy the value of “Callback URL” from Salesforce to the Redirect URL to the Redirect URI field in the connected app in Exact Online.

3. Create a Named Credential in Salesforce.

In Setup, navigate to Security -> Named Credentials, and at the top right, click “New Legacy”. Create a Named Credential with the following settings:

We will set up a connection to https://start.exactonline.nl, depending on your country this URL can change (for example for Germany we use https://start.exactonline.de).

...

After saving the Named Credential you will be redirected to Exact Online, where you will be asked to confirm the connection between Salesforce and Exact Online.

Sync overview

The following fields sync between GoMeddo Subscription Management and Exact Online.

Exact field

Salesforce field

Notes

DEBITEUR

Name

Account.Name

Email

Account.Subscription25__Billing_Email_Address__c

Formula field referencing: Account.Subscription25__Billing_Attendant_To__r.Email

Phone

Account.Phone

VATNumber

Account.Subscriptoin25__VAT_Number__c

Configurable in a custom setting: CLIENT_VAT_NUMBER_FIELD

BankAccount > IBAN

Account.Subscription25__IBAN__c

Configurable in a custom setting:
CLIENT_IBAN_FIELD

ChamberOfCommerce

Configurable in a custom setting: CLIENT_ACCOUNT_COC_FIELD

SalesPaymentCondition

Configurable in a custom setting: CLIENT_ACCOUNT_PAYMENT_METHOD_FIELD

Addresses – Billing

Account.BillingAddress

Addresses – Visiting

Account.Subscription25__Visiting_Street__c etc.

Standard address in Exact can be set in a custom setting:
EXACT_VISITING_ADDRESS

Addresses – Shipping

Account.ShippingAddress

...

Exact field

Salesforce field

Notes

INVOICE LINE

Item (Artikel)

Fixed value “STANDAARD”

Configurable in a custom setting: CLIENT_ARTICLE_FIELD

GLAccount

Subscription25__Ledger_Number__c

Via Subscription25__Administration_Product__c object

UnitPrice

OrderItem.UnitPrice

Quantity

OrderItem.Quantity

VAT

Subscription25__VAT_Code__c

Via Subscription25__Administration_Product__c and Subscription25__VAT_Code__c objects

StartDate

OrderItem.ServiceDate

Only if it does not fall in the same month as the invoice date

EndDate

OrderItem.EndDate

Only if it does not fall in the same month as the invoice date

Description

OrderItem.PricebookEntry.Product2.Name – OrderItem.Description

Configurable in a custom setting: CLIENT_INVOICE_LINE_DESCRIPTION_FIELD

Note

Configurable in a custom setting: CLIENT_INVOICE_LINE_NOTES_FIELD

Costcenter

Configurable in a custom setting: CLIENT_COST_CENTER_FIELD

Costunit

Configurable in a custom setting: CLIENT_COST_UNIT_FIELD

Create a Connected app in Exact Online.

Use the following steps to create a connected app in Exact Onlinehttps://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Process-appcenter-eol-appcenter-dev-registerapp-p. When creating a new connected app, set the Redirect URI to a mock value, like https://gen25.com.

Create an Auth. Provider in Salesforce.

In Setup, navigate to Identity -> Auth. Providers and click “New”. Create an Auth. Provider with the following settings. The values for Consumer Key and Consumer Secret should be copied from the fields Client ID and Client Secret of Connected app that was created in the first step.

...

After the Auth. Provider is saved, copy the value of “Callback URL” from Salesforce to the Redirect URL to the Redirect URI field in the connected app in Exact Online.

Create a Named Credential in Salesforce.

In Setup, navigate to Security -> Named Credentials, and at the top right, click “New Legacy”. Create a Named Credential with the following settings:

We will set up a connection to https://start.exactonline.nl, depending on your country this URL can change (for example for Germany we use https://start.exactonline.de).

...

After saving the Named Credential you will be redirected to Exact Online, where you will be asked to confirm the connection between Salesforce and Exact Online.

TIM ALLES HIERONDER MAG WEG

...

You now have to create an Auth. Provider of type Open ID

Create a Named Credential

And specify the name of that named credential on your administration

Create OAuth Token

To set up the Salesforce to Exact Online integration, we require an OAuth Token to be present. The OAuth Token can be created by running the following piece of code in the Anonymously in the Developer Console.

...

The id that is logged on line 8 will be important for the next step, make sure you write it down. In the rest of the document, we reference this id by using <ID>.

We will set up a connection to https://start.exactonline.nl, depending on your country this URL can change (for example for Germany we use https://start.exactonline.de).

Code Block
languagejava
Subscription25__OAuth_Token__c oAuthToken = new Subscription25__OAuth_Token__c();
oAuthToken.Name = 'Exact Online';
oAuthToken.Subscription25__Client_Id__c = '-';
oAuthToken.Subscription25__Client_Secret__c = '-';
oAuthToken.Subscription25__Endpoint__c = 'https://start.exactonline.nl';

Database.insert(oAuthToken);
system.debug(oAuthToken.Id);

Navigate to the following URL, replacing <ID> with the Id of the record you just created, http://login.salesforce.com/apex/Subscription25__OAuth?tokenId=<ID>

You are now redirected to a new page, copy the URL of that page.

The URL should look something similar to https://<YOURDOMAIN>.visualforce.com/apex/OAuth?tokenId=<ID>

Create Exact App Centre OAuth App

Log into Exact App centre on https://apps.exactonline.com/, press manage my apps in the top right corner.

...

Press register an app, give it the name “Salesforce”, for the redirect URI use the URL we just copied. Accept the terms and press Register.

You will see the page, from this page we will need to copy the Client ID and the Client Secret.

...

Update OAuth Token

Navigating back to the developer console of Salesforce, run the following piece of code. Replace <ID> with the id of the token from Salesforce, replace <CLIENT_ID> with the Client ID copied from the Exact Authorisation Details above, replace <CLIENT_SECRET> with the Client Secret copied from the Exact Authorisation details.

Code Block
languagejava
Subscription25__OAuth_Token__c OAuthToken2 = [
  SELECT Subscription25__Client_Id__c, Subscription25__Client_Secret__c 
  FROM Subscription25__OAuth_Token__c 
  WHERE Id = '<ID>'
];

oAuthToken2.Subscription25__Client_Id__c = '<CLIENT_ID>';
oAuthToken2.Subscription25__Client_Secret__c = '<CLIENT_SECRET>';
Database.update(OAuthToken2);

Create a remote site setting

Salesforce will communicate from Salesforce to Exact Online by using an URL which should be whitelisted in your remote site settings of Salesforce, in this example we use https://start.exactonline.nl. Which might change based on your Exact instance.

Info

Salesforce explains how to create a remote site setting on this page: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_remote_site_settings.htm

  1. From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.

  2. Click New Remote Site.

  3. Enter a descriptive term for the Remote Site Name.

  4. Enter the URL for the remote site.

  5. Optionally, enter a description of the site.

  6. Click Save.

A remote site setting would look something like this:

...

Activate the token

Navigate back to the URL you used before to grab the URL: http://login.salesforce.com/apex/Subscription25__OAuth?tokenId=<ID>

Press the Authorize button. You are navigated to Exact Online and might to log in again. After you’ve done this you need to accept the terms:

...

After you’ve done this you are redirected to Salesforce and will need to press the Get Refresh Token button. You will get a success notification after you’ve done this.

...