Contents
How are distance and geolocation supported in soql?
DISTANCE and GEOLOCATION are supported in WHERE and ORDER BY clauses in SOQL, but not in GROUP BY. DISTANCE is supported in SELECT clauses. DISTANCE supports only the logical operators > and <, returning values within (<) or beyond (>) a specified radius.
How are location based soql queries used in Salesforce?
Location-based SOQL queries let you compare and query location values stored in Salesforce. You can calculate the distance between two location values, such as between a warehouse and a store.
How are compound Fields returned in soql query?
Compound fields are returned as structured data rather than primitive values. For example: This query retrieves the same data as the previous query, but the Location__c field is a compound geolocation field, and the results combine the two primitive values. Here are sample results from a REST API request.
Where do the latitude and longitude values come from in soql?
SOQL supports using simple numeric values for latitude and longitude using the GEOLOCATION function. These values can come from standard numeric fields, user input, calculations, and so on. They can also come from the individual components of a geolocation field, which stores both latitude and longitude in a single logical field.
How to do a location based soql query?
For example: This query finds all the warehouses that are stored in the custom object Warehouse. The results include each warehouse’s latitude and longitude values individually. To select the latitude and longitude components individually, use separate field components for Location__c.
How to translate soql query results into another language?
To translate SOQL query results into the language of the user who submits the query, use the toLabel method. Any organization can use the toLabel () method. It’s particularly useful for organizations that enabled the Translation Workbench. The toLabel method uses the following syntax: