Skip to content

A project where, through the OpenCage API, we can fill the Location/Address fields in the Account object records in Salesforce.

Notifications You must be signed in to change notification settings

brunagirao/opencagegeocoder-account-trigger

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn Trailhead


Logo

OpenCage Geocoder API | Salesforce Account Object

A project where, through the OpenCage API, we can fill in the Location/Address information in the Account object records in Salesforce.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contact
  4. Acknowledgments

About The Project

  • In this project, I integrate the Salesforce CRM with the 3rd party API OpenCage Geocoding API.
  • About OpenCage Geocoding API: this API provides worldwide, reverse (latitude/longitude to text) and forward (text to latitude/longitude) geocoding based on open data via a REST API. For this project I used these two resource, doing a single implement for each one.
  • About Salesforce: I created the OpenCageGeocoderService class responsible to call the 3rd party API and the AccountTrigger responsible for call the service class each time that an Account record is created or update.

Account Record | Geolocation and Address Information

(back to top)

Built With

  • Salesforce
  • OpenCage-Geocoder-API

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

For this project, you need a Salesforce Developer Edition.

Installation

  1. Get a free API Key at OpenCage API - Quick Start
  2. Clone the repo in your VS Code or IntelliJ
    git clone https://github.com/brunagirao/opencagegeocoder-account-trigger.git
  3. Deploy all the code and configs in your Salesforce Developer Edition.
  4. On Salesforce, go to Setup > Custom Settings > Select Open Cage Geocoder Settings image
  5. On Open Cage Geocoder Settings > Click Manage > Click in New > Create the **Open Cage Geocoder Settings record **below image
  6. After create Open Cage Geocoder Settings record. You will have this: image
  7. After that, go to AccountTriggerHandler and uncomment one of the methods below to test the functionalities.
    • AccountHelper.fillLocationCoordinatesFields: this method uses the reverse resource of the OpenCage API and it's responsible to fill the Account Shipping Address based on Account Coordinate fields. image

    • AccountHelper.fillShippingAddressFields: this method uses the forward of the OpenCage API and it's method responsible to fill the Account Coordinates fields based on Account Shipping Address. image

(back to top)

Contact

(back to top)

Acknowledgments

(back to top)

About

A project where, through the OpenCage API, we can fill the Location/Address fields in the Account object records in Salesforce.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages