Please note that this is about Lightning Experience (with actions overridden), not Classic. So, getParameters() doesn't work here. Here is the output if someone needs to see it's output.
{id=XXXXX, isdtp=p1, nonce=XXXXX, sfdc.override=1, sfdcIFrameHost=web, sfdcIFrameOrigin=https://cs31.lightning.force.com}
I'm using Visualforce page in Lightning experience. The page is used to override edit/view pages.
In that page, there is button to open edit page which is binded to following function.
public PageReference customEdit() {
PageReference viewPage = new ApexPages.StandardController(customer).edit();
viewPage.setRedirect(true);
return viewPage;
}
When that button is clicked. URL is getting changed to .../edit
But how can i determine whether the page is in edit or view mode in the apex controller ?
View page URL -
https://cs31.lightning.force.com/one/one.app#/sObject/XXXXX/view
Edit page URL -
https://cs31.lightning.force.com/one/one.app#/sObject/XXXXX/edit
id
param and the controller uses getParameters to get the Id param and it works just fine in Lightning. Of course I believe we are using two different navigation methods so maybe thats it – Eric May 10 '17 at 0:52