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
michaelkaelmichaelkael 

S-control {!Account.BillingStreet} doesn't work

Hello

 

I'm only want to display the account localization in the google map but it doesn't work as soon as I put the {!Account.BillingStreet} field in the javascript script.

 

 

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 100% }
</style>
<script type="text/javascript"
    src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
  function initialize() {
   var geocoder = new google.maps.Geocoder();
   var latlng = new google.maps.LatLng(40.046455,-76.7465579 );
    var myOptions = {
      zoom: 8,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
  var map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
  alert("test SF Michael"+"{!Account.BillingStreet}");
  geocoder.geocode( { 'address': "{!Account.BillingState},{!Account.BillingPostalCode},{!Account.BillingCity},{!Account.BillingCountry}"}, function(results, status) {
      if (status == google.maps.GeocoderStatus.OK) {
        map.setCenter(results[0].geometry.location);
        var marker = new google.maps.Marker({
            map: map,
            position: results[0].geometry.location
        });
      } else {
        alert("Geocode was not successful for the following reason: " + status);
      }
    });
//alert("{!Account.BillingCity},{!Account.BillingPostalCode},{!Account.BillingState},{!Account.BillingCountry}");
  }

</script>
</head>
<body onload="initialize()">
  <div id="map_canvas" style="width:99%; height:99%; border:1px solid"></div>
</body>
</html>

b-Forceb-Force

Please check out the value of {!Account.BillingStreet}

 

using alert("{!Account.BillingStreet}");

 

thanks,

bala