You need to sign in to do that
Don't have an account?
Roberto Nisti
Try instantiated a constructor but doesn't work
Hello,
I try instaciated a constructor as:
string address1 = CheckAndFeed.descricaoenderecouser(terapeutaId);
string address2 = CheckAndFeed.descricaoendereco(accId);
googlemaps gerarota = new googlemaps(address1, address2);
And my constructor is:
public class googleMaps {
public String duration {get;set;}
public Integer travelTime {get;set;}
public Decimal distance {get;set;}
public googleMaps (
String address1,
String address2) {
system.debug('In google maps');
String jsonResults = getJsonResults(address1, address2);
system.debug('After Json');
...
It doesn't work, object isn't instatiated. I don't know why.
I try instaciated a constructor as:
string address1 = CheckAndFeed.descricaoenderecouser(terapeutaId);
string address2 = CheckAndFeed.descricaoendereco(accId);
googlemaps gerarota = new googlemaps(address1, address2);
And my constructor is:
public class googleMaps {
public String duration {get;set;}
public Integer travelTime {get;set;}
public Decimal distance {get;set;}
public googleMaps (
String address1,
String address2) {
system.debug('In google maps');
String jsonResults = getJsonResults(address1, address2);
system.debug('After Json');
...
It doesn't work, object isn't instatiated. I don't know why.
I have tried your code and instance is created, system.debug('In google maps'); is printed. There might be some problem in your getJsonResults(address1, address2); method.
Best Regards,
Sandhya