+ Start a Discussion
Chidanand MChidanand M 

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

function nextRec(){
            var cycleAccounts = localStorage['CycleAccounts'].split(',');
            var accId='{!Account.Id}';
            accId= accId.substring(0, accId.length - 3);
           // var currentAccountPos = cycleAccounts.indexOf('{!Account.Id}');
           var currentAccountPos = cycleAccounts.indexOf(accId);
            if(currentAccountPos == cycleAccounts.length - 1){
            alert('This was the Last Account!');
            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.

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]);

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