1

I am seeking to rerender opportunity detail section from embedded visualforce page. based on click of button lightning detail section should be refresh.

getting error : $A is undefined

Detail section and embedded VF page

<script>
 $Lightning.use("c:Applet", function() {
 $Lightning.createComponent("c:refresh",
 { 
**$A.get('e.force:refreshView').fire();**
 },
 "refreshContainer",
 function(cmp) {
 console.log('do something ');
 });
 });
 </script>

Thanks in Advance!

2 Answers 2

1

I do not believe you can $A.get('e.force:refreshView').fire() inside Lightning out as it is only available in Lightning container.

0

By using the component script avoid collision detection ..

<aura:component implements="flexipage:availableForAllPageTypes" access="global">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

({   
doInit: function(cmp) {        
    window.addEventListener("message", function(event) {
        if (event.data === "reloadOpp") {
            autoRefresh();
        }
    }, false);        
    function autoRefresh(){           
        $A.get("e.force:refreshView").fire();             
    }
}

})

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .