Hi Friends,
Today we will learn "How to Call Lightning Component from Visualforce Page". I have added comments on the main code for your understanding. I have used this Vsualforce Page on the Salesforce button.
Let's Start
1. The button will open under the Contact object.
2. The child object is "Case".
3. The button code is below.
Today we will learn "How to Call Lightning Component from Visualforce Page". I have added comments on the main code for your understanding. I have used this Vsualforce Page on the Salesforce button.
Let's Start
1. The button will open under the Contact object.
2. The child object is "Case".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <apex:page standardController="Case" standardStylesheets="false" showHeader="false"> <!-- Include a JavaScript file in your Visualforce page --> <apex:includeLightning /> <div id="lightning" /> <script> //"CaseApp" is your Lighning Component App Name (This is mandatory to create App) $Lightning.use("c:CaseApp", function() { // "c:caseComponent" is your Lightning Component Name // which is using in your Lightning Component App $Lightning.createComponent("c:caseComponent", { //"recordId" - This is your component attribute & "{!Case.Id}" is your Object Id "recordId" : "{!Case.Id}", }, "lightning", function(cmp) { // do some stuff }); }); </script> </apex:page> |
3. The button code is below.
On our next blog post we will discuss that how to we can call the Lightning Component on the Salesforce Custom Tab.
Thank You for Come to my blog ....
1. Create Re-Usable Custom Lookup In Salesforce Lightning Component
2. How to Create Custom Lookup In Lightning Component