Salesforce Integration

Integrating into Salesforce to create an address form.

Implementing the Plugin

The Salesforce plugin is integrated by installing the Autoaddress package, setting the required variables included with the package and dropping included Visualforce pages into the desired locations. 

Requirements

  1. Package installation link: https://login.salesforce.com/packaging/installPackage.apexp?p0=04t1v0000021oFb&isdtp=p1
  2. A license key, provided by Autoaddress. Contact Autoaddress sales team for more information.

Implementation

Installation

Open the package installation link, found in the requirements section of this document, in preferred browser. Salesforce may require a login at this point. Enter the your login details and this will open the Autoaddress installation page:

N.B Version information may differ from what is shown above.

Click the "Install" button and the package will begin to install:


Once the package is installed, Salesforce will display the following:


Clicking the "Done" button will open your salesforce instance.

Verifying the Installation

The package will have installed a number of items for the plugin. To view these items, select the cog at the top right corner of the page and select "Setup" from the drop down menu:

sf2

In the "Quick Find" search box on the left, search for "labels" and select "Custom Labels" from the list

In the list of custom labels, 3 Autoaddress labels will have been added:

The AutoaddressCountrySelector label will determine whether the plugin will allow users to change the country that the service will search addresses for. Set this value to true to allow changing the country or false to hide the option. The default value is set to true.


The AutoaddressDefaultCountry label will determine the country the plugin will initially be set to search in when it loads. The default value is "ie" (without the quotation marks) for Ireland and can also accept "ni" for Northern Ireland and "gb" for United Kingdom including Northern Ireland.

N.B The ability to search for addresses in countries other than Ireland is determined by your licence key. You will be unable to search for other countries if your subscription does not include this, even if the AutoaddressCountrySelector is set to true or the AutoaddressDefaultCountry is set to anything other than "ie".

The AutoaddressKey label is where your licence key will need to be set which you can get by contact our sales team. The default value of this label is "YOUR KEY HERE". Replace this value with your key.


Next, in the Quick Find search box, search for "Visualforce" and select "Visualforce pages" from the list. This page will now contain three Autoaddress Visualforce pages:


AutoaddressLeadSearch will be available for Leads items, AutoaddressAccountSearch will be available for Accounts items and AutoaddressContactSearch will be available for Contacts items.

You can also view the package as a whole by searching for packages in the Quick Find search box and selecting "Installed Packages" from the list. 

Implementing Autoaddress with the Salesforce Lightning App Builder 

This document will use the Sales Console app to show how to drop the plugin into the Contact page.
Open the app launcher and select “Sales Console”.

 

In the Sales Console, select Contacts.

Click on the cog symbol in the top right of the page and select “Edit Object” from the drop-down box.
sf14
This will bring you to the object manager for the Contacts object. From the list on the left, select "Lightning Record Pages" which will look like below.

Select the most up to date record of the page. This will open a page like this:

Select the "Edit" button. This will bring you to the “Lightning App Builder page”.

On the left side of the screen is a list of “Lightning Components”. Scroll down the list until you find the “Visualforce” component. Drag this component to where you would like it to display. This will open the Visualforce settings to the right of the screen. Click the field labelled "Visualforce Page Name" and select "AutoaddressContactSearch"  from the list (For Leads, the value should be "AutoaddressLeadSearch" and for Accounts, "AutoaddressAccountSearch"). We would also recommend unticking the "Show Label" check box and setting the Height to 530. 

 

Integrating Autoaddress as a Tab

The preferred method of integrating the service would be to setup the plugin in its own tab. To do this, in the Lightning App Builder, select the main component (the one with tabs labelled "Activity" and "Details" etc.). This will open the tab settings on the right. From here, select "Add Tab".

Adding a tab will default to a new tab called "Details". Click this new tab and change the value from "Details" to "Custom":

Next, fill in the "Custom Label" field and click "Done". The tab has been named "Autoaddress" for the purposes of this guide, however, it can be named as you see fit. 

After clicking "Done", a new tab named Autoaddress will appear in the tab list:

    Select the tab to open its content and select "Add Component(s) Here". Next, select the Visualforce component from the list on the left and it will populate into the Autoaddress tab. Next ensure that the "Visualforce Page Name" field is set to "AutoaddressConatctSearch".

    Save and Test

    Finally, once the page has been added, select the save button in the top right:


    N.B Please note, depending on your instance setup, it may be required to activate the page for the org or the app. If this is required, the changes won't be visible until that is done so activate as appropriate for your site before continuing.

    Once the changes have been saved, click the back button in the top left:


    Navigate to Contacts in the Sales Console and select a contact. The Autoaddress plugin will now be available in the position it was set:


    The country selector will only appear if the AutoaddressCountrySelector custom label is set to true. If the AutoaddressKey has been set with a licence key, the search will now be available. Once completed a search, a "Save" button will show at the bottom of the page:


    Clicking the save button will save the address information displayed in the address fields and reload the  contact page. The saved info will now display in the address section of the details tab: