Connecting to Salesforce

Integrating SalesForce into ReportMagic means you can:
  • Create internal sales reports
  • Use the customer contact's contact information in your customer-facing reports
  • List current opportunities, projects etc. in your customer-facing reports

Creating a Connected App In SalesForce

To set up a Salesforce connection, as a Salesforce administrator, create a new Connected App:
  1. Under Platform Tools, expand Apps and click App Manager.
  2. Click the New Connected App button and provide the following:
    • Connected App Name = ReportMagic
    • API Name = ReportMagic
    • Contact Email = <your email address>
  3. Select the Enable Oauth Settings checkbox and then select the Enable for Device Flow checkbox.
  4. In the Callback URL box, enter the appropriate URL which depends on whether you are connecting to a Live or Sandbox Salesforce instance:
    • If Production (Live), or you are using a developer instance, use: https://login.salesforce.com/services/oauth2/success
    • If Test (Sandbox), use: https://test.salesforce.com/services/oauth2/success
  5. Include at least the following selected Oauth Scopes:
    • Access and manage your data (api)
    • Access your basic information (id, profile, email, address, phone)
    • Perform requests on your behalf at any time (refresh_token, offline_access)
    • Provide access to your data via the Web (web)
  6. Ensure the Require Secret for Web Server Flow and the Require Secret for Refresh Token Flow checkboxes are selected.
  7. Leave all other default settings untouched and save the App.
  8. Under Platform Tools, expand Apps and click App Manager.
  9. Locate the newly created ReportMagic app, click the drop down arrow then click Manage. 
  10. Click the Edit Policies button and in the Oauth Policies section:
    • Ensure that Permitted Users is set to "All users may self-authorize"
    • Ensure that IP Relaxation is set to "Relax IP Restrictions"
    • Leave all other default settings untouched and save the App
  11. Under Platform Tools, expand Apps and click App Manager.
  12. Locate the newly created ReportMagic app. click the drop down arrow then click View. 
  13. In the API (Enable Oauth Settings) section:
    • Copy the Consumer Key value (will be required later)
    • Copy the Consumer Secret value (will be required later)
  14. In Salesforce create a new user for ReportMagic use, noting the username and password.  It can be linked to any email address in your organisation and should have ReadOnly Salesforce permissions.
  15. The owner of this user account should log in to Salesforce and RESET the password for the account. Do this by going to View Profile and clicking Settings. Then in the menu, under My Personal Information, click Change My Password and enter and save a new password. Note down the new password.
  16. After the password change (an existing token is invalid when a password is changed), create a new Security Token by going to View Profile, clicking Settings then in the menu, under My Personal Information, clicking Reset My Security Token.  On the page displayed, clicking the Reset Security Token button will email a new Security Token to the user's email address.  This will be needed later.

Adding the SalesForce Connection in ReportMagic

In ReportMagic, add a new Salesforce Connection as follows:
  1. From the Admin menu, click Connections.
  2. Click the Create button.
  3. Enter a name and description and a Connection type of Salesforce.
  4. In the URL field, enter the relevant value depending on whether this is a Live or Sandbox Salesforce instance (it should be the same value as the Callback URL of the Connected App):
    • For Production (Live), use:  https://login.salesforce.com/services/oauth2/token
    • For Test (Sandbox), use: https://test.salesforce.com/services/oauth2/token
  5. In the Username field, enter the username created above. 
  6. In the Password field, enter the password created above followed immediately by the Security Token (emailed above). So if your password is ABC and your security token is 123, enter ABC123.
  7. In the Configuration field, add the Consumer Key and Consumer Secret for the ReportMagic App (Saved above), in the following JSON form:
    { "ClientId":"Consumer Key Value", "ClientSecret": "Consumer Secret Value" }
  8. Click Save and ensure that the new connection has a valid green checkmark next to it in the Status column.
An unhandled error has occurred. Reload 🗙