I am getting a little lost here and have read the related topics on stackexchange carefully. I am using the standard controller for a custom object in a managed package. This code works perfectly in a deployed org, but when I put it into my dev org I get the error. I am prefixing with name space and using fully qualified fields.

Here is the VF page code;

<apex:page standardController="ELTON__Equipment_Count__c">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
  html, body, #map_canvas {
    margin: 0;
    padding: 0;
    height: 100%;
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
  var map;
  function initialize() {
    var mapOptions = {
      zoom: 12,
     center: new google.maps.LatLng({!ELTON__Equipment_Count__c.ELTON__GPS_Lat__c},{!ELTON__Equipment_Count__c.ELTON__GPS_Long__c} ),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    map = new google.maps.Map(document.getElementById('map_canvas'),
        marker = new google.maps.Marker({position: new google.maps.LatLng({!ELTON__Equipment_Count__c.ELTON__GPS_Lat__c},{!ELTON__Equipment_Count__c.ELTON__GPS_Long__c}), map: map });

  google.maps.event.addDomListener(window, 'load', initialize);
 <div id="map_canvas"></div>

I was able to resolve this by pasting in the code from eyescream directly.

  • BTW if you fixed the namespace then implemented GPS per @eyescream, your references would read as Equipment_Count__c.GPS__Latitude__s and Equipment_Count__c.GPS__Longitude__s – bigassforce Feb 2 '13 at 0:39
  • did you try this? salesforce.stackexchange.com/a/7984/320 – bigassforce Feb 4 '13 at 13:35
  • hey @GordonDerk, please can you paste the final code you used? – bigassforce Feb 25 '13 at 0:25

Happens to me sometimes even in standard (unpackaged) code. Can you try putting your Lat/Long merge fields somewhere closer to the top of the page (before they're actually used). Sth like

<apex:outputPanel style="display:none;visibility:hidden">

I have no idea what actually happens, probably the suggesting engine in VF skips over certain Javascript tags (but I saw it complaining also in vanilla HTML). Basically something might get stupid underway and the internal equivalent of addFields() is not being called properly.

P.S. You know you SF has now built-in Geolocation fields, do you? ;)

| improve this answer | |
  • That was it thanks. I am aware of the goelocation fields in beta, but I cannot seem to find a reference to when they will be GA. I am adding this mapping functionality now. Thanks again for your help, this one really got me. – Gordon Derk Feb 4 '13 at 15:52
  • Glad it helped (I seriously have no idea why, what I do is a bit of "cargo cult" programming). Regarding geo fields: I think they're Generally Available already (since Winter'13), beta means it's still worked on but not something done as pilot /opt-in program! I have them in my 2 Dev Editions (one ancient from 2007, one from Jan'13), I saw them in 1 Enterprise and 1 Unlimited Edition. If you really don't have them enabled - contact support? I remember filtered lookups & joined reports were beta too but that didn't stop you from relying on them in "production" instances... – eyescream Feb 4 '13 at 16:45
  • hey @GordonDerk - are you still qualifying the namespace in your field accessors? – bigassforce Feb 25 '13 at 0:24

My first thought would be to check your Field Level Security settings. If you don't have access to those fields in this new environment, it will cause you issues.

| improve this answer | |

You can fix this by removing the ELTON__ qualifiers and letting the platform resolve the namespace.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.