+ Start a Discussion
Chidanand MChidanand M 

Browser get's refreshed only for admin. But it doesn't refresh for users.

function nextRec(){
        
            
             alert('hii');
        
            if(localStorage['CycleAccounts']){
            var cycleAccounts = localStorage['CycleAccounts'].split(',');
            alert(cycleAccounts);
            alert('{!Account.Id}');
            var accId='{!Account.Id}';
            accId= accId.substring(0, accId.length - 3);
            alert(accId);
           // var currentAccountPos = cycleAccounts.indexOf('{!Account.Id}');
           var currentAccountPos = cycleAccounts.indexOf(accId);
            alert(currentAccountPos);
            
            if(currentAccountPos == cycleAccounts.length - 1){
            alert('This was the Last Account!');
            }
            else{
            
            parent.parent.frames.location.replace('/apex/accExample?id='+ cycleAccounts[currentAccountPos + 1]); 

            }
            }
                   
        
        }

Hi All,

1. If i login as a admin, browser gets refreshed with the updated id's
2.If i login with user other than admin, browser doesn't get refreshed.

Can somebody help me, It's very urgent.

TIA
Sergio AlcocerSergio Alcocer
It looks to me that is because you have developerMode ON and  you are relying on the frame that this mode creates.
try replacing 
parent.parent.frames.location.replace('/apex/accExample?id='+ cycleAccounts[currentAccountPos + 1]);

with 
top.location.replace('/apex/accExample?id='+ cycleAccounts[currentAccountPos + 1]);
or just
top.location = ''/apex/accExample?id='+ cycleAccounts[currentAccountPos + 1];

Marking best answers is good for all.
  • Other users with same question: will be easier to find the right answer without having to go through all of the conversation
  • Other users that knows the answer: saving time before they realise its already answered properly
  • Author: makes him/her happy