You need to sign in to do that
Don't have an account?
Ab
Trigger to calculate time and distance using Google Maps API in Salesforce.com
Hello,
I am integrating Google maps with Salesforce using below link
http://www.bulkified.com/How+to+use+the+Google+Maps+API+in+Salesforce.com
This above example gives a VF page to calculate.
I have below Objects:
ObjectA__C
CustomField__1
CustomField__2
CustomField__3
When Address is entered in CustomField__1 and CustomField__2, I want to calcuate the distance and time and fill it automatically in CustomField__3.
thanks for suggestion !
I am integrating Google maps with Salesforce using below link
http://www.bulkified.com/How+to+use+the+Google+Maps+API+in+Salesforce.com
This above example gives a VF page to calculate.
I have below Objects:
ObjectA__C
CustomField__1
CustomField__2
CustomField__3
When Address is entered in CustomField__1 and CustomField__2, I want to calcuate the distance and time and fill it automatically in CustomField__3.
thanks for suggestion !
, once you have the JSON you can write JSON parser
OR you can try JSON serialize to convert JSON into Object and thenyou can easy move the data into your custom object
public String getJsonResults( String address1, String address2)
{
HttpRequest req = new HttpRequest();
Http http = new Http();
req.setMethod('GET');
String url = 'https://maps.googleapis.com/maps/api/distancematrix/json' + '?origins=' + address1 + '&destinations=' + address2 + '&mode=driving' + '&sensor=false' + '&language=en' + '&units=imperial';
req.setEndPoint(url);
HTTPResponse resp = http.send(req); return jsonResults;
}