By Proximity

Suppose you want to search using proximity. For this, we have created the custom action with name “Inogic.Maplytics.API.Proximity” (ikl_InogicMaplyticsAPIProximity).

Custom action accepts following parameters:

  • CurrentLocation: Location for which you want to do the proximity search.

  • Proximity: Provide the proximity radius. e.g., 3. If you want to do Concentric Proximity search, then specify multiple proximity radii separated by comma ‘,’. For example, 5, 10, 15.

  • DistanceUnit: Provide the radius unit. It can be either “mile or kilometer". If the unit is not specified then by default mile will be considered as the radius unit.

  • Records: EntityCollection

  • Entity: Provide the entity name. e.g. “Account"

  • ViewName: Specify the view name. e.g., “My Active Accounts”

When user passes the required parameters and executes this action then it will return records colle

Note: As custom action has 2 minutes timeout so maximum records that are processed is around 90K- 100K. If you have a view having records more than 100K then it may throw a timeout issue. So, make sure to enter the viewname of the view that has less then 100K records.

To execute proximity action using the C#, use the following code.

//create request object
string requestName = "ikl_InogicMaplyticsAPIProximity";

                    //create request object
                    OrganizationRequest orgReq = new OrganizationRequest(requestName);
                    //for proximity
                    orgReq["CurrentLocation"] = "New York";
                    orgReq["Proximity"] = "10,25";
                    orgReq["DistanceUnit"] = "Mile";
                    //Entity & view
                    orgReq["Entity"] = "account";
                    orgReq["ViewName"] = "My Active Accounts";
                    OrganizationResponse response = service.Execute(orgReq);

                    EntityCollection recordsCollection = (EntityCollection)response.Results["RecordsCollection"];

To execute the action using the javascript (web api) you can use following code.

Last updated

Was this helpful?