Questions tagged [geolocation]

The Geolocation field type allows for SOQL queries based on location and distance. Functions DISTANCE and GEOLOCATION support distance and location-based SOQL queries.

Filter by
Sorted by
Tagged with
30
votes
1answer
3k views

What formulae does the Geolocation Distance use?

Forgive me if this is a bit extremely academic in nature, but I was wondering how Salesforce goes about determining the distance between two pairs of latitude and longitude? When I've looked at this ...
10
votes
3answers
5k views

can geolocation fields be used to calculate and display distance?

I have a geolocation field setup on an object and want to be able to display the distance from another location in miles on a Visualforce page. I see with the new geolocation fields you can use ...
10
votes
3answers
3k views

Geolocation searching

I'm researching location search (ultimately on a Force.com site). For example's sake, the problem is to dynamically show a user what stores are w/in a certain distance (say miles) of a postal code ...
10
votes
4answers
552 views

Multiple Geolocation targets within a single SOQL query

Afternoon, I need to search for all objects within X miles of a set of known geo-located lat-longs. I've been looking at the geolocation features of SF but I don't see any mention of using multiple ...
8
votes
2answers
354 views

Error when setting “rendered” attribute on apex:mapMarker

I am trying to show/hide some map markers on an <apex:map> by assigning a boolean value coming from an Apex attribute to the rendered tag. However, I am receiving a compile error on save: ...
7
votes
1answer
6k views

Are latitude and longitude saved automatically?

I'm wanting to use the BillingLatitude and BillingLongitude fields attached to my Account object in a workflow rule, but I can't seem to get them to work. I pulled an export via Data Loader of the ...
7
votes
2answers
1k views

BillingAddress in query generate error

I have a query like below in an Apex Class in Sandbox. query = 'SELECT Id, Name, BillingAddress, BillingLatitude, BillingLongitude FROM Account WHERE Name = \''+ name +'\' AND '; query += '...
6
votes
2answers
2k views

Is there any way to have a formula field displayed on Standard Edit Page Layout?

I use a Standard Page Layout (Account, Contact etc). I use standard page edit view to edit and update object (like this) On Standard Display View Layout I use Formula field to display Location (as ...
6
votes
1answer
2k views

Use GPS on a device to determine geolocation inside salesforce.com custom object

I've been looking for a way to capture the geolocation from a devices (iphone, ipad, etc) GPS and set the location value on a custom object. Looking to add an interactive google map or something to ...
6
votes
3answers
253 views

SOQL Query to retrieve Contacts from an Account sorted by the distance between the contact location and the account location

I'm trying to create a SOQL query to retrieve Contacts from Accounts, with the contacts for each account sorted by the distance between the contact location and the account location. This is what I ...
5
votes
4answers
5k views

No such column Location__c using Geolocation field beta

I'm attempting to build a google map page that displays all sites within 5km of a certain point. I've added a Geolocation field called Location__c, and attempting to build a list of the sites in the ...
5
votes
3answers
1k views

Is “Maps and Location (New!)” missing in the setup of Developer Orgs?

In Production- and Sandbox-Orgs (on EU0) there is a menu-entry in the setup called Maps and Location (New!) It is located between "Tab Names and Labels" and "Home" As an unfortunate this menu ...
5
votes
2answers
344 views

Detect the location of the user of web to lead

In web to lead, you can input any address that you want.I need to detect the exact location or just the state or city of the user who used the web to lead. Is this possible? any ideas how? Thanks in ...
5
votes
1answer
1k views

Find nearest branch from ZIP code entered by customer

We need to calculate the distance between the ZIP code entered by customer and the nearest branch (Branch is an object) to that ZIP code address. The Lat and Long values are calculated for both ZIP ...
5
votes
2answers
3k views

Calculating Map Driving Distance?

I have a salesforce geolocation field that i've put in coordinates. Is it possible to be able to get driving distance from that field? Or would i have to do it with google maps API? There was ...
4
votes
1answer
372 views

System.Location class in Apex - why is it described in docs and why I can't use it in code?

At first I've found out that I can't refer SObject field with type Geolocation directly, I get Data type not supported: Location But I can access mySObject__Latitude__s and longitude. I've tried ...
4
votes
1answer
98 views

Multi-Route Processing

Business Case I work for a non-profit that uses volunteers to deliver meals to their clients. Based on their volunteer-recurrence schedule, and the client's meal-recurrence schedule, each volunteer ...
4
votes
1answer
348 views

Access DISTANCE SOQL Result in Visualforce

I am trying to access the result of a DISTANCE SOQL Query in visualforce but I cannot figure out how to do this. The correct values do appear in debugging. Below is my relevant code: Controller: ...
4
votes
1answer
751 views

Display a count of records within 15 miles of a subscriber ZIP code

I have an ExactTarget question. I have a data extension of _subscribers. One of the fields is their zip_code I have another data extension of _widgets which includes the widgets' zip_code1 I also ...
3
votes
3answers
379 views

Geolocation in a List Controller?

I've successfully used geolocation in a list controller: public class NearbySiteProgramListCon { // ApexPages.StandardSetController must be instantiated // for standard list controllers public ...
3
votes
3answers
824 views

Getting Lat and Long in SalesForce

I'm new to SalesForce and I'm working on an app that requires me to calculate distance between two given addresses. User enters 2 addresses and then I calculate the distance between those two ...
3
votes
1answer
126 views

Live Agent Geo-location feature

Has anyone implemented a way to prevent users from initiating a chat if a visitor is coming from a country where customer has no presence using geo-location within live agent. Are their any best ...
3
votes
1answer
2k views

How to set geocode custom field?

I know how to set the Lat/Lng on standard Geocoding fields, but let's say I have Geocode__c on a custom object. Do I set the Lat/Lng by simply doing: CustomObjectInstance.Geocode__c.Latitude__c = ; ...
3
votes
1answer
37 views

Is Contact othergeocodeaccuracy a legitimate field?

Many of our Continuous Integration builds just failed with hundreds of this error: System.QueryException: No such column 'othergeocodeaccuracy' on entity 'Contact'. Our code does describe calls ...
3
votes
2answers
868 views

Get details of Image selected from <apex:inputFile>

I want to get the details of the uploaded image To choose Image I am using following code in VF <div class="form-group"> <label class="lbl">Image</label> <apex:inputFile value="...
3
votes
1answer
2k views

Enable VisualForce Map Component apex:map

I have found to my delight that there is now a standard map component. However, it is apparently not enabled for my org. How do I enable them? Is this feature still in beta? All the listed features ...
3
votes
1answer
4k views

How to display Location part of Address field type

Is there any way to display Geolocation part of Address field type in edit or display mode? Account object contains specific BillingAddress field of Address type (is in beta). Also, as mentioned here,...
3
votes
3answers
1k views

Is it possible to use the DISTANCE SOQL function without a GEOLOCATION field, or some other approach?

I want to make a SOQL call to "near me" filter the ACCOUNT records server-side. (Too many to bring down and filter on the client). It would seem that using DISTANCE function in the call would suit, ...
3
votes
1answer
279 views

Is it possible edit Geolocation custom field in Inline mode?

I have custom field Location of Geolocation type for standard objects (Account, Contract, Lead etc). For example, I want this field to be editable. On Edit Layout it is editable by default. But ...
3
votes
0answers
178 views

Cannot read property 'appendChild' of undefined

I want to show the geoposition on a leaflet map lightning component. I enter an Id and get geolocation data accordingly. When I first enter an Id everything works fine, for the second time it shows ...
3
votes
0answers
186 views

Salesforce1 stopped supporting geolocation

I have a Visualforce page enabled for Lightning, which has one button that gets the geolocation in coordinates and shows the location in a Google map embedded in the page. This was working until last ...
3
votes
0answers
93 views

is it possible to fill address lead fields automatically with geolocalization from within salesforce1? [closed]

I would want customize my salesforce1 app so that we can add a new lead and auto-fill the address lead fields with a location button using the geolocation feature of my mobile device. Would it be ...
2
votes
2answers
226 views

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

I just noticed that one of my queries is no longer working in my sandbox after the Spring '18 has been applied to that sandbox. In particular this is the error SF is returning: [object Object]: 'mi')...
2
votes
2answers
54 views

Distance between two places based on geolocation

I am trying to write a query to find contacts within a radius of 50 miles and here is the SOQL i have select Id,Name,mailingStreet,mailingState,mailingCity,mailingPostalCode,mailingcountry,...
2
votes
1answer
1k views

returning distance in soql select

Has anyone found a way to use the DISTANCE function in a SELECT phrase. I've seen how to use it in the WHERE and ORDER BY clauses, but what I'm trying to do is something like... SELECT id, name, ...
2
votes
3answers
445 views

Geolocation field, inconsistent unit test results IDE vs. UI

I'm using the new Geolocation field data type and SOQL DISTANCE function in a Visualforce page. I'm using the SOQL with DISTANCE to retrieve records into a standardSetController. It works great - ...
2
votes
1answer
448 views

Can't filter by geolocation field in SOQL [closed]

I'm trying to do a simple SOQL query to find all opportunities that have a null geolocation field, however, the query keeps blowing with: Save error: field 'Coordinates__c' can not be filtered in ...
2
votes
1answer
184 views

Where can I find the Latitude__s and Longitude__s fields Or how to capture Latitude__s and Longitude__s via api

I am new in implementing and using the location fields . Need to know where can I find the Latitude__s and Longitude__s fields? Trying to bring this data from salesforce but cannot find what object ...
2
votes
1answer
840 views

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

Using an Apex callout to Google Maps geocoding API, I want to authorize narrowly within Google to protect the client ID from being reused by anyone else. I believe the referer header needs to match ...
2
votes
1answer
602 views

How to deploy a Layout with a Related List containing a Geolocation field using ant/the Metadata API?

Using ant, when doing a retrieve() of a Layout containing a Related List, containing a Geolocation field (see abridged, sanitised example below), the relatedLists node contains two entries for the ...
2
votes
1answer
1k views

How do you get the lat/long of an apex:mapMarker that has been geocoded in Visualforce?

As of API 32.0, it's easy to create a map in Visualforce with <apex:map> and <apex:mapMarker> even takes string addresses as a position and will geocode the address automatically. You can ...
2
votes
1answer
93 views

Incorrect Longitude and Latitude

The Geolocation Longitude and Latitude coordinates I am getting out of Salesforce are not the same as the Google coordinates for the same address. When I load an Account or Contact address the Map ...
2
votes
1answer
55 views

Geolocation of all leads and accounts in Sales Cloud

my fashion organization is planning to buy Sales Cloud. One of the requirements of the sales men is to see in a map (Google Maps style) all leads and accounts (with type = "store") and also the ...
2
votes
0answers
46 views

How can i keep a track of someone visits the My site? [closed]

One item to be aware of the event is not triggered when a form is filled out but when someone visits the site. And when someone visit the my site in one day several times means how can i save/track ...
2
votes
0answers
216 views

Geolocation not working for certain locations

We have a strange issue with geolocations in Salesforce, We have activated the data integration and geolocation based on billing address. While this works well in many countries, it does appear that ...
2
votes
1answer
166 views

Account Billing/Mailing lat and long values are not populated in test data from integration rules

I have setup the necessary Account Data Integration Rules for the billing address but in a test context these values are not being populated. I can't find any documentation on when/how the values get ...
2
votes
1answer
184 views

Marketing Cloud SMS Push to users in market

We have some geofencing set up to push a message to users when they cross a boundary. We have a hurricane coming and we want to notify users who are in the city right now. Does anyone know of a way to ...
2
votes
0answers
310 views

Get user's Geolocation by capturing the IP address from the open made on the email

Is this possible in Exacttarget? Has anyone try this yet?
2
votes
1answer
74 views

geolocation when user logs in or logs out?

I am using the login flow which has been released as part of Winter'15 release. I would like to pass the geolocation of the logged in person (using javascript HTML5 Geolocation API) to visual flow as ...
2
votes
0answers
360 views

Is there a way to use native features in Salesforce1?

I wonder if the APIs are available, using which we can use phone hardware: Camera GPS Storage This could help build some awesome application! I know this is not what Salesforce1 is built for. But ...