-
Notifications
You must be signed in to change notification settings - Fork 6
Chapter 4: Automation and Bulk Verification
What to do with existing records, or records that will be imported into Salesforce in bulk
n this section you will learn what you can do in order to clean up existing data in Salesforce, and how you can make sure that your data stays clean. In the previous section we explain how to let users verify individual addresses and in the next section, we get into the new Autocomplete feature, but here we discuss the back-up plan for all of this – what to do when a record is saved in Salesforce and is not perfectly clean.
If the amount of records you need to clean up is not huge, you might be able to clean them 200 at a time using our list view button. Even if the number of records is too large to do cleanup manually, it is always a good idea to configure the option in case you want to use it in the future.
You can set up a button to verify multiple addresses at one time from a standard Salesforce.com list. We will step through how to do it for Leads, but the process is very similar for Accounts and Contacts, and even custom objects.
The button will now be available from any Lead list view. You can select as many records as you want, up to 100 and then press the Verify Selected Addresses.
- Please note several things when verifying multiple addresses at once:
- You will use up a SmartyStreets.com Address Lookup for every address. So, even though you verify 100 at a time, you are still charged for 100.
- If addresses are very long, sometimes Salesforce.com (not SmartyStreets) will choke on multiple verifications at once, and will show you an error. If that happens, please try selecting less addresses and trying again.
A button can also be added for multiple-record address validation for custom objects. Please follow these steps and you should be able to add the button fairly easily.
First, create a simple Visualforce page by going to Setup->App Setup->Develop->Visualforce pages, and press the “New” button. Then, paste the code below into the page area:
<apex:page
standardController="Object_Name __c"
extensions="smartystreets.VerifySelectedAddressesExt"
recordSetVar="leads"
sidebar="false"
showHeader="false">
<smartystreets:VerifyAddressesList
Controller="{!setCon}" />
</apex:page>
Replace the highlighted “Object_Name__c” with the API name of the custom or standard object.
- Note: Make sure to select the " Available for Lightning Experience, Lightning Communities, and the mobile app” option when creating the page, as this will allow it to appear in Lightning as well as Classic.
Next, go to the object you want to verify, and find the “Buttons, Links and Actions” section and then create a new button. Set it as a “List Button” with the “Display Checkboxes (for Multi-Record Selection)” option ON, and have the behavior “Display in Existing Window without sidebar or header.” Under the Content Source, select “Visualforce Page” and then select the page you created in the steps above.
Now, you will need to add this button to the search layout as shown at the beginning of this chapter, and you are good to go!
A word about JavaScript buttons. We still provide the code for JavaScript buttons in our repository. These can be used in Classic Salesforce, but are no longer recommended by Salesforce. If you are currently using Classic, it is OK to stay with them as they provide a somewhat faster experience, but our recommendation is to move to either a Lightning Component or a Visualforce page as described above.
Depending on the amount of records in Salesforce, and the ongoing process of ingesting new records into the org, many companies need an automated solution that will do the work for them in the background. Address Verification provides several options.
You can turn on automatic verifications via Trigger for the Lead, Account and Contact objects in Salesforce. This will automatically verify any addresses configured on these objects whenever they are imported or updated. This feature is easy to turn on:
- Go to Setup App Packaging Installed Packages and click on the Address Verification app. Once there, you can click the “Configure” button.
- In the Setup page, click the AUTOMATION tab, then select one or more of the “Automatically Verify” fields and press the “Save Settings” button. You can select Accounts, Contacts or Leads.