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
Paul F-2Paul F-2 

Anchor URL for a Google map infoWindow to redirect to a Salesforce object details page?

I'm following the Google map example in the Salesforce 1 App Developer Guide.  As in the example, I want to wrap the marker infoWindow in an anchor tag so clicking on the infoWindow contents will redirect to the approriate Salesforce object.  The guide has the code shown below, which works in Salesforce 1 but not in Salesforce.  In Salesforce, I get the following errors:

Refused to display 'https://na15.salesforce.com/a03i0000006qClnAAE' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Uncaught SecurityError: Sandbox access violation: Blocked a frame at "https://c.na15.visual.force.com" from accessing a frame at "https://c.na15.visual.force.com".  The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.

What is the proper URL for redirecting from a Google map infoWindow in a Visualforce page to a standard Salesforce object details page?

Thanks for any help that you can provide.


Salesforce 1 App Developer Guide sample code:

try{
if(sforce.one){
warehouseNavUrl =
'javascript:sforce.one.navigateToSObject(
\'' + warehouse.Id + '\')';
}
} catch(err) {
console.log(err);
warehouseNavUrl = '\\' + warehouse.Id;
}
var warehouseDetails =
'<a href="' + warehouseNavUrl + '">' +

Paul F-2Paul F-2
I got this working by changing the href attribute value and adding the target attribute:

var infoWindowURL = '<a href="../' + warehouse.Id + '" target="_parent">';
var infoWindowDetails =
             infoURL +
... +
'</a>';