0

I have a Visualforce page with a standard controller and an extension.

It has a delete button:

<apex:commandButton action="{!delete}" value="Delete" onclick="return confirm('Are you sure?');"/>

In Classic it works as expected - it returns to the list page.

In Lightning, after confirming the 'Are you sure?' dialog, I get an error page:

Data Not Available

The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page. 

The object has been deleted, as expected, but it seems that LEX tries to return to the deleted object page, which obviously fails.

How can I change this VF page to work in both Classic and Lightning?

  • How are you directing users to this page? Is it a custom button/action on the record? – John Towers Mar 3 '17 at 17:46
  • How does <apex:commandButton work in lightning? where is it placed in? – Itai Shmida Mar 5 '17 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.