+ Start a Discussion
Piyush Sharma 6Piyush Sharma 6 

Custom button to add default account team.


Is there a way to know the exact logic behind Add Default Team button on Account Team Member related list on account. I have created a custom visualforce page and wants to extend this functionality.
On click on button takes to this url: 
In above url Id and tid values are clear but I am not able to obtain _CONFIRMATIONTOKEN.

I tried by getting its value from url and setting it in page reference when user selects Add Default Team, using below code:
confirmationToken = ApexPages.currentPage().getParameters().get('_CONFIRMATIONTOKEN');
PageReference pgRef = new PageReference('/opp/addsalesteam.jsp');
pgRef.getParameters().put('id', accId);
pgRef.getParameters().put('tid', '005');
pgRef.getParameters().put('_CONFIRMATIONTOKEN', confirmationToken);
But I am getting below error: 
Stale Session Exception
The page you submitted was invalid for your session. Please refresh your page and try again. 

I am not sure what I am missing. Any thoughts?