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
nathanael.mnathanael.m 

Page reference setRedirect(true) behaviour inconsistent across instances

There are differences in how the redirect is being handled across instances.

On na7 the behaviour is incorrect and the redirect page returned is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

<script>
if (window.parent.location.replace){
window.parent.location.replace('https://cms.na7.visual.force.com/apex/editpagelayout?id=a08A0000000JF87IAG&sname=SampleSite');
} else {;
window.parent.location.href ='https://cms.na7.visual.force.com/apex/editpagelayout?id=a08A0000000JF87IAG&sname=SampleSite';
}
</script>

</head>
</html>

You'll notice that it sets the window.parent.location in order to redirect. This should not be the case. For example if the page being redirected is in an iframe you lose the parent's context.

On na6 the behaviour is as it should be and so is the page that performs the redirect:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">

<script>
if (window.parent.location.replace){
window.location.replace('https://cms.na7.visual.force.com/apex/editpagelayout?id=a08A0000000JF87IAG&sname=SampleSite');
} else {;
window.location.href ='https://cms.na7.visual.force.com/apex/editpagelayout?id=a08A0000000JF87IAG&sname=SampleSite';
}
</script>

</head>
</html>
This difference results in our application working as intended on na6 but not on na7. I thought Salesforce used a single code base for all the instances?