Skip to main content
8 votes
Accepted

Unable to fetch latitude & longitude in apex

Automatically populating Longitude and Latitude data for the standard Billing/Shipping Address fields on Account was introduced in Summer '16, but it appears that it needs to be manually activated. ...
Derek F's user avatar
  • 62.3k
7 votes
Accepted

Geofencing push notifications in Marketing Cloud

First, Geofence Notifications are not push notifications. They are downloaded and triggered upon fence transitions. Take a look at the SDK's convenience methods for should show notification (ref. ...
Bill Mote's user avatar
  • 5,286
5 votes
Accepted

How to calculate distance between two records

DISTANCE & GEOLOCATION are SOQL Methods, you can't use them in apex. Thanks for your comment kurunve, so as documented here, this should work in Apex: Location loc1 = Location.newInstance(28....
itsmebasti's user avatar
  • 6,467
4 votes
Accepted

Using Field Value in setEnpoint() URL

You can't generally use merge fields in Apex (except for Dynamic Visualforce components). Instead, you'd use normal string concatenation, or my personal preference, a PageReference: PageReference ...
sfdcfox's user avatar
  • 495k
4 votes

Live Agent Geo-location feature

As a best practice: don't do it (at least, automatically). Just because they appear to be located in a place you don't service does not mean they are in that place, or that they live there permanently....
sfdcfox's user avatar
  • 495k
4 votes
Accepted

How to refer Geolocation field type in visualforce page from custom object?

Try geo_location__latitude__s && geo_location__longitude__s
GI Joe's user avatar
  • 111
4 votes
Accepted

Additional code for pushing geofencing messages

You should remove the following lines of code. The SDK will handle retrieving the messages when it is appropriate and you do not have to initiate this. [ETRegion retrieveGeofencesFromET]; [ETRegion ...
Jeff Sylvia's user avatar
4 votes
Accepted

Contact Mailing Latitude & Longitude is zero despite map feature working

You have to activate Activate the Data Integration Rule for Data.com Geo. Then, geocodes are automatically added to existing accounts, contacts, and leads. New accounts, contacts, and leads get this ...
Saroj Bera's user avatar
  • 14.7k
3 votes
Accepted

Can't filter by geolocation field in SOQL

Take a look at this article on how to use GEOLOCATION fields in SOQL Essentially you will need to use DISTANCE function that calculates distance between two coordinates and then use GEOLOCATION() ...
Mohith Shrivastava's user avatar
3 votes
Accepted

Geo-coordinates on billing address for account object non-existent

Double check your address. There is most likely a typo in the street number. Google will still be able to show an approximate location of a street number despite it not being a correct address, ...
sfdcfox's user avatar
  • 495k
3 votes
Accepted

Spring '18 no longer supporting Order by Distance and geolocation type

Noticed the same issue this Monday. Here is the mot recent update from SF Support them (got at 8am EST today) Hi Evgeny, Good day! Thank you for your heads up. We noticed this is as a spring 18 ...
WebSolo's user avatar
  • 46
3 votes

Spring '18 no longer supporting Order by Distance and geolocation type

What instance is your sandbox? I have the same problem in one client's sandbox (CS9) but not in another client's sandbox (CS17) even though both are at Spring 18. In the CS9 sandbox, I even created ...
David Cheng's user avatar
  • 7,091
3 votes

Geolocation with LockerService

We use navigator.geolocation.getCurrentPosition() in a Lightning for Communities app with LockerService enabled. Here's some sample code you can use to prove that it works within LockerService. Set ...
Jake Richter's user avatar
  • 1,361
3 votes
Accepted

Get details of Image selected from <apex:inputFile>

Following page utilizes Exchangeable Image File library and apex:inputfile example. Exif.getData function reads GPS data from image and stores it as description in document record. VF: <apex:...
Ilya Lepesh's user avatar
  • 4,125
3 votes
Accepted

Is Contact othergeocodeaccuracy a legitimate field?

For your question: Is Contact othergeocodeaccuracy a legitimate field? It does seem to be a legitimate field. The field is listed in the SOAP API docs with the following description: Accuracy ...
Jayant Das's user avatar
  • 30.6k
3 votes
Accepted

FSL How to Track Users Locations?

There are three fields on the ServiceResource Object; LastKnownLatitude and LastKnownLongitude, as well as LastKnownLocation with is Field Set of these two. There is also LastKnownLocationDate which ...
DC-Fencer's user avatar
  • 197
3 votes

Account Object Geocode Fields Not Showing On Page Layout

It'd recommend you to get familiar with Geolocation Custom Field Help Page. Unfortunately you cannot expose this field on a layout. However, it's still possible to show its value by using a text ...
Przemysław Długoszewski-Tamoń's user avatar
2 votes

Get details of Image selected from <apex:inputFile>

To get the location info of the image you have to read EXIF info of the image. I do not know whether Apex has out of the box methods to do it. Any body can let me know if it is there. But you can do ...
Saroj Bera's user avatar
  • 14.7k
2 votes
Accepted

Is it possible to use the setHeader method on HttpRequest Class to set the referer?

This is an old question, but it is actually possible to use the setHeader() method to set the Referer. I had to make sure it was spelled 'Referer' (notice the capitals and the old-school misspelling) ...
Grisk's user avatar
  • 256
2 votes
Accepted

Getting Lat and Long in SalesForce

As of Summer '16, you can take advantage of platform supported geolocation for certain standard fields. These fields are: BillingAddress on Accounts ShippingAddress on Accounts ...
battery.cord's user avatar
  • 8,835
2 votes

Getting Lat and Long in SalesForce

I've got a function I used in an older project which does exactly this, using some custom settings to store the API Keys used for the transactions. This example does require you to have a valid Google ...
battery.cord's user avatar
  • 8,835
2 votes

Multi-Route Processing

Nice problem description, very interesting! What's wrong with the first route addressing all clustered (no-steps) meals in an area? It's an effect of the optimization you're doing. And in the end it ...
Guy Clairbois's user avatar
2 votes
Accepted

Order By clause using APEX Bind Variables in Geolocation SOQL gives GACK

So I raised a case with Salesforce and got the below response. We have heard back from R&D and Tier-3 . The issue is due a bug with old compiler , there is a workaround which you could ...
Pranay Jaiswal's user avatar
2 votes
Accepted

Marketing Cloud SDK - geolocation fence error

This issue was identified a few days ago. There is a fix that will be published in the upcoming SDK release. I'll update this post once it is released.
Seth's user avatar
  • 941
2 votes
Accepted

Distance between two places based on geolocation

I think you are missing a - on the east/west coordinates? 30.2672, 97.7431 is somewhere in China 30.2672, -97.7431 is in Austin
BritishBoyinDC's user avatar
2 votes

Geolocation Query

Here's an example, which is a derivative of the official wiki post on this topic. If you don't have the X, Y and Z axis data, then you'll need to calculate it first: select zip , cos(radians(...
Adam Spriggs's user avatar
  • 30.8k
2 votes

Geo Location Push Messages Exclusion List

Geofence messages are cached on the device and presented immediately upon triggering a fence entry/exit, however, there is a convenience method in the Marketing Cloud MobilePush SDKs that allows you ...
Bill Mote's user avatar
  • 5,286
2 votes
Accepted

soql query to retrieve nearby vendors for an account

SOQL cannot dynamically compare field values with other field values, and it is not possible for a SOQL query to use details from one record while querying other records without these values being ...
Phil W's user avatar
  • 36.8k
1 vote

How to use Geocode field to display address info?

I don't think this would be that straightforward as you are thinking. We cannot achieve it using Point and Click. You need to make a call out to any of the geocoding services (ex: Google Reverse ...
brahma's user avatar
  • 1,012
1 vote

Capture location through smart capture or form on custom cloud pages in salesforce marketing cloud

This will be a pure front-end implementation, hence agnostic in terms of whether it is running on Cloud Pages or any other platform. You can use some of the many jQuery plugins out there to accomplish ...
Lukas Lunow's user avatar
  • 21.7k

Only top scored, non community-wiki answers of a minimum length are eligible