function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rick_93Rick_93 

Call Lightning Event from VisualForce Page

Hi,

I want to call a Lightning Component event from a Visualforce page in a Community.

I've tried in this way
 
<div id="lightning" style=""></div>

<script>
$Lightning.use("c:TheApp", function() {
	$Lightning.createComponent("c:TheComponent", {},
		"lightning",
		function(cmp) {
			createdCmp = cmp;
			var myExternalEvent;
			myExternalEvent = $A.get("e.c:TheEvent");
			myExternalEvent.setParams({
				"p": 'p',
			});
		myExternalEvent.fire();
	});
});
</script>
It's working but it is not what I exactly want, because in this way the compnent is inserted in the page a runtime.

Is there a way to call the event without inserting the component a runtime, but inserting it in the page with the community builder ?

Thanks in advance.
sandeep@Salesforcesandeep@Salesforce
Hi Rick, 

You may visit this link it may be helpful for you. 
https://developer.salesforce.com/blogs/developer-relations/2017/01/lightning-visualforce-communication.html

Thanks 
Sandeep Singhal
http://www.codespokes.com/
 
Amit Jadhav 13Amit Jadhav 13
hello 
i create a vf page for event 
my requirement is show the Parent account,Contact Name,Account Name,Meeting Date,Title in one pageblock table.
how its possible 
please tell me

thank in advance