function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

System.CalloutException: Callout from triggers are currently not supported.

Hello,

Excecuting below code inside trigger gave me below exception

System.CalloutException: Callout from triggers are currently not supported.
trigger XYZ on Account (before update) {

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);

}

Thank you for suggestion !
Best Answer chosen by Ab
Sanpreet SainiSanpreet Saini
Hi Sandrine, 

Please review the below help link this will resolve the issue. 

https://help.salesforce.com/apex/HTViewSolution?id=000176570&language=en_US

Feel free to mark this as resolved if this resolves your issue. 


Regards, 
Sanpreet