Newer Version Available
Retrieve the Territories in Which the Records Reside
The PointInPolygon() Apex method
returns the territory shape in which each record resides. It reads in the geographical
coordinates of one or more records and compares each against the surrounding territory
shape.
Signature
Where,
- maps is the namespace that's available after you install Salesforce Maps.
- API is the class that contains the global methods exposed to developers.
- PointInPolygon() is the method.
Sample Code
This code reads in the geographical coordinates of two records and returns the territory
shape in which each resides.
Input Format
Example
Sample Response
Although the return value is an Apex Map<String, Object> object, this JSON response illustrates the essential data you receive in the resulting map.