+ Start a Discussion
Haseeb Ahmad 9Haseeb Ahmad 9 

Issue while calling to Lightning (Aura) Component from VF page

Hello I need help to figure out when the VF page is not able to call the Lightning component correctly 

Following this article: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_visualforce.htm


When I make a call I am able to launch the lightning component in the VF page but if I click any button it Is not working and I am getting this error.

User-added image
When I click the cancel button it should redirect me back to the opportunity record page but it not happening.

If I use that lightning component in a quote action it works perfectly but not when I call from the VF page. 

any thought? 
ANUTEJANUTEJ (Salesforce Developers) 
Hi Haseeb,

Can you post a sample snippet that can be checked in our demo org so as to look further and respond.

Haseeb Ahmad 9Haseeb Ahmad 9
Hi Anutel,

Thank you for your help.

Here is the code for the VF page and application.

VF page: 
<apex:page controller="OpportunityTriggerHandlerHelper" sidebar="false" showHeader="false" standardStylesheets="false" >
    <apex:includeLightning />

    <div id="createScopingRequest"></div>

        $Lightning.use("c:scopingRequest", function() {
                    function(cmp) {
                        console.log('App is working');

<aura:application extends="ltng:outApp" access="global" >

Please let me know if you need code for the lightning component as well thank you.