Versions Compared

Key

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

This article is out of date. We will update this soon.

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 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.

...

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>

...