Setup
This is a VF page that is embedded in a STD layout. It's function is to conditionally render, display a warning, and do a redirect.
Problem
This code works fine in IE 9, FF, and chrome, but NOT IE 8. What am I doing wrong/what's going on? The user clicks the 'ok' btn and he doesn't go anywhere. I tried this in Compatibility and Non-Compatiblity mode. OR the user will get sent to the "URL No Longer Exists" page.
<apex:page standardController="Opportunity" standardStylesheets="true" extensions="OpportunityController" >
<body style="background:#f3f3ec" >
<apex:form id="form">
<script>
function onComplete2(){
var r=confirm("Click OK to continue and change the Record Type without saving changes. To save any changes, click cancel and then save your work");
if (r==true){
window.parent.parent.window.location = ("{!redirect}");
}
}
</script>
<center>
<apex:commandButton action="{!save}" reRender="form" onComplete="onComplete2()" value="Change Record Type"/>
</center>
</apex:form>
</body>
</apex:page>
Apex
public with sharing class OpportunityController {
String oppId;
public OpportunityController(ApexPages.StandardController controller) {
this.oppId = ApexPages.currentPage().getParameters().get('id');
getRender();
}
public PageReference getredirect(){
PageReference p;
String s = '/setup/ui/recordtypeselect.jsp?id=' + this.oppId +'&retURL=%2F'+ this.oppId;
p = new PageReference(s);
p.setRedirect(true);
return p;
}
public boolean getRender(){
if ( UserInfo.getProfileid().left(15) == '00e30000000bulF') { //00e30000000bulF = sys admin.
return true;
}
Group g = [select id from group where developerName = 'test'];
List <GroupMember> gm = [Select UserOrGroupId, GroupId From GroupMember where groupId = :g.id];
for(GroupMember x: gm){
if (userinfo.getUserId().left(15) == x.UserOrGroupId){
return true;
}
}
return false;
}
}