1

I was working in salesforce classic and i override view button on contact with a visualforce page :

And when i open the same page in lightning its giving the same look and feel as of classic and yes its not following the lightning rules also like i placed a onClickjavascript button in page layout and now my contact detail page showed js button.

So i thought of making changes to my VFP page by checking if that page is opening in classic or lighinig by using $User.UIThemeDisplayed in my page. https://trailhead.salesforce.com/modules/lex_dev_visualforce/units/lex_dev_visualforce_multipurpose_pages

I was thinking to use force:recordView https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_force_recordView.htm

but in this link its mentioned it won't work with Lightning Out properly.

--------App-----------

<aura:application access="global" extends="ltng:outApp">
    <aura:dependency resource="c:contactDetailPAge"/>
    <c:contactDetailPAge />
</aura:application>

------cmp--------------

<aura:component>
    <force:recordView recordId='0033600000GtRskAAF' type="FULL"/>
</aura:component> 

<!--Hardcoded the id just for checking-->

---------VFP--------------

<apex:page standardController="Contact">
    <apex:detail />
</apex:page>

This is my vfp page that i need to modify to include the lightning component which displays will display detail page of contact record.

So, my app is not loading and if i remove extends="ltng:outApp" from my application file it works fine.

So i dont think this way will work as i can only override the view button with a visualforce page(i need to display this component through my visualforce page).

So is there is any way i can achieve this? need to display my contact detail page as other standard detail page in lightning through a visualforce page.

  • for overriding standard button with VF page refer this – Rohit Mourya Mar 10 '17 at 13:45

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.