1

I have 2 Visualforce pages and I want to override the New, View and Edit actions of one of my custom Object. The New and Edit works perfect, but the view button still opens the salesforce standard page even it shows visualforce page overridden in object setup. What should I do in this case. I can place a button on record home page which takes me to my custom page but I want to override the view action of my custom object in lightning experience. It works in salesforce classic very well.

Your suggestions would be well appreciated.

Here is the code of my VF Page

<apex:page standardController="Timesheet__c" extensions="kandidaatController" docType="html-5.0" standardStylesheets="false" sidebar="false">
  <apex:includeLightning />

  <div id="lightning"></div>
    <script>
         var kandidateId = '{!checkBoxVal}' ;
         var kanId = '{!kanIdVal}' ;
         var Id= '{!Timesheet__c.Id}';
          if(kandidateId == 'true'){
               $Lightning.use("c:TimeSheetApp", function() {
                $Lightning.createComponent("c:TimeSheetViewCmp",
                {"timesheetId":Id,"kandidatId":kanId },
                "lightning",
                function(cmp){
                // do some stuff
                });
            });
         }
         if(kandidateId == 'false'){
               $Lightning.use("c:TimeSheetApp", function() {
                $Lightning.createComponent("c:TimeSheetEditCmp",
                {"timesheetIdSec":Id,"kandidatIdSec":kanId },
                "lightning",
                function(cmp){
                // do some stuff
                });
            });
         }
    </script>


</apex:page>
3
  • can you double check, else provide code or visual force page.
    – Raj_SFDC
    Oct 5, 2016 at 14:38
  • Hi Raj, Thanks for the reply. What should I Double Check ? But IF you need code then I have attached the code in the question. Thanks Oct 6, 2016 at 7:28
  • If I understand your problem correctly view override is working fine in classic but not in lightning experience. Oct 11, 2016 at 11:45

1 Answer 1

1

Hi Ajay Sharma,

     View mode overriding with visualforce is not supported in Lightning experience.

Reference: https://trailhead.salesforce.com/en/lex_dev_visualforce/lex_dev_visualforce_known_issues

enter image description here

I hope this answers your question.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.