+ Start a Discussion
Roshan TamrakarRoshan Tamrakar 

URL structure for Console Tab VS Detail Tab

I heard a little about isdtp=mn parameter.

I have a vf page inside Account under a section. A button in that page opens new case window. In order to achieve this I create a new url with the help of pagereference and returns to the page. This opens the case window. When I cancel, I am returned to the account and if I save I am returned to saved case.
It works fine. However if I do the same from the console window, the whole page is refreshed and the new case window is displayed (it should open within the Account detail frame). When I cancel/save, I am not returned to the console instead I returned to the Account (on cancel) or Case (on save).

Below is the code in s-control which I am converting to vf page with apex class.

var desktop = new DesktopApi();
if (desktop.desktopPageWindow) {
} else{


I am not sure how I can do above in apex class.

My first issue..How could I know that I am in desktopPageWindow from apex class?
Second, If I got it...how my parameters will change?

Below is my method which I am currently using:

public PageReference CreateNewCase(Id retUrlId, Id contId, Id acId, String prmFunc, Id prmEntId, Id prmspId, String prmEntName){
 CaseOrigin = '&cas11='+EntUtil.GetDefaultPicklistValueFromCase('origin');
 Status = '&cas7='+EntUtil.GetDefaultPicklistValueFromCase('status');
 String sPriority = EntUtil.GetDefaultPicklistValueFromCase('priority');
 Priority = '&cas8='+sPriority;          
 PageReference page = new PageReference('/500/e—retURL=/'+retUrlId+CaseOrigin+Status+Priority);        
 return page;

 Please help.