{"id":2389,"date":"2017-03-27T08:53:08","date_gmt":"2017-03-27T08:53:08","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/salesforce\/?p=2389"},"modified":"2025-06-12T07:19:57","modified_gmt":"2025-06-12T07:19:57","slug":"add-lightning-components-to-visualforce-page","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/salesforce\/2017\/03\/27\/add-lightning-components-to-visualforce-page\/","title":{"rendered":"Add Lightning Components to VisualForce Page"},"content":{"rendered":"<p style=\"text-align: justify;\">Salesforce has reimagined the platform from Classic to Lightning. With the lightning version, accessing data and tools has become easier. The major advantage of Salesforce Lightning over Salesforce Classic is its faster response time with enhanced user interface. Lightning uses its own set of components and design system which is different from Salesforce Classic. The Lightning apps are built around lightning components and till date the use of lightning components were restricted to Lightning apps. However, for all those users who were keen on using Lightning components in their VisualForce page, there is a work around.<\/p>\n<p style=\"text-align: justify;\">This post shows how to implement this functionality of adding Lightning Components to VisualForce Page. Proceed with the following steps: &#8211;<\/p>\n<ol>\n<li>\n<p style=\"text-align: justify;\">Create a lightning component, named \u201cLightningCompForVF\u201d either through developer console or through your IDE. Use the below mentioned code in your lightning component.<\/p>\n<\/li>\n<\/ol>\n<div id=\"attachment_2390\" style=\"width: 886px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/1.-Lightning-Component.png\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" aria-describedby=\"caption-attachment-2390\" class=\"wp-image-2390 size-full\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/1.-Lightning-Component.png\" alt=\"Lightning Component\" width=\"876\" height=\"242\" \/><\/a><p id=\"caption-attachment-2390\" class=\"wp-caption-text\">Lightning Component<\/p><\/div>\n<ol start=\"2\">\n<li>\n<p style=\"text-align: justify;\">Post creation of lightning component, create a style class for the same component and use the below code in the class.<\/p>\n<\/li>\n<\/ol>\n<div id=\"attachment_2391\" style=\"width: 365px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/2.-Style-class-for-lightning-component.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" aria-describedby=\"caption-attachment-2391\" class=\"wp-image-2391 size-full\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/2.-Style-class-for-lightning-component.png\" alt=\"Style class for lightning component\" width=\"355\" height=\"331\" \/><\/a><p id=\"caption-attachment-2391\" class=\"wp-caption-text\">Style class for lightning component<\/p><\/div>\n<ol start=\"3\">\n<li>\n<p style=\"text-align: justify;\">Now use this Lightning component in a Lightning app. For this, we recommend you to create a new Lightning app, named \u201cLightningAppForVF\u201d and use the lightning component in this app.<\/p>\n<\/li>\n<li>\n<p style=\"text-align: justify;\">Create a VisualForce page that will display this lightning component.<\/p>\n<\/li>\n<li>\n<p style=\"text-align: justify;\">VisualForce page should provide the interface where the lightning component that we are going to use in the page can be viewed. Use the below code in your VisualForce page.<\/p>\n<\/li>\n<\/ol>\n<div id=\"attachment_2392\" style=\"width: 960px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/3.-Visualforce-page-code.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" aria-describedby=\"caption-attachment-2392\" class=\"wp-image-2392 size-full\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/3.-Visualforce-page-code.png\" alt=\"Visualforce page code\" width=\"950\" height=\"425\" \/><\/a><p id=\"caption-attachment-2392\" class=\"wp-caption-text\">Visualforce page code<\/p><\/div>\n<p style=\"text-align: justify;\">Once the page is created and previewed, the Lightning component will appear in your VisualForce page. Although this is just a demo, it does open doors for developers to experiment and implement lightning components in VisualForce pages.<\/p>\n<div id=\"attachment_2393\" style=\"width: 593px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/4.-Vf-page-preview.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2393\" class=\"wp-image-2393 size-full\" src=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-content\/uploads\/2017\/03\/4.-Vf-page-preview.png\" alt=\"Vf page preview\" width=\"583\" height=\"195\" \/><\/a><p id=\"caption-attachment-2393\" class=\"wp-caption-text\">Vf page preview<\/p><\/div>\n<p style=\"text-align: justify;\">With the help of Lightning components, the VisualForce page will be less monotonous and you can enjoy the functionalities of Salesforce Classic page, a perfect example of best of both the worlds.<\/p>\n<p style=\"text-align: justify;\">For an advanced example and in depth understanding please visit the site- <a href=\"https:\/\/www.jitendrazaa.com\/blog\/salesforce\/use-lightning-component-in-visualforce-page\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.jitendrazaa.com\/blog\/salesforce\/use-lightning-component-in-visualforce-page\/<\/a><\/p>\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><br \/>\n<a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0as a Salesforce Product development partner offers a wide variety of integration products and services to the end users as well as to the Partners across the globe. We offers Consultation, Configuration, Training and support services in out-of-the-box functionality as well as customizations to incorporate custom business rules and functionalities that requires apex code incorporation into the Salesforce platform.<\/p>\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0has some unique solutions for Cloud CRM such as Salesforce integration with\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Sage Enterprise Management (Sage X3<\/a>),\u00a0Sage Intacct, <a href=\"https:\/\/www.greytrix.com\/product\/sage-100-erp\/gumu-100-salesforce-integration\">Sage 100\u00a0<\/a>and\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\">Sage 300 (Sage Accpac)<\/a>. We also offer best-in-class Cloud CRM\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/crm-development\/salesforce-com\">Salesforce customization and development services<\/a> along with services such as Salesforce <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/data-migration-services\">Data Migration<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/integrated-application-development\">Integrated App development<\/a>, <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/custom-development\">Custom App development<\/a> and <a href=\"https:\/\/www.greytrix.com\/product\/professional-services\/maintenance-support\">Technical Support<\/a> to business partners and end users.<\/p>\n<p>Greytrix GUMU&#x2122; integration for Sage ERP \u2013 Salesforce is a 5-star app listed on <a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n<p>For more information, please contact us at\u00a0<a href=\"mailto:salesforce@greytrix.com\">salesforce@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n<p><span style=\"font-size: Medium;\"><strong>Related Posts<\/strong><\/span><\/p>\n<ul>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/10\/03\/configure-salesforce-sage-300-integration\/\" target=\"_blank\" rel=\"noopener\">Configure Salesforce \u2013 Sage 300 integration<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/11\/21\/real-time-details-in-gumu-sage-300-erp-integration-for-salesforce\/\" target=\"_blank\" rel=\"noopener\">Real-time details in GUMU SAGE 300 ERP Integration for Salesforce<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2017\/03\/06\/using-gumu-link-existing-salesforce-accounts-with-sage-300-erp-customers\/\" target=\"_blank\" rel=\"noopener\">Link Existing Salesforce Accounts with ERP Sage 300 Customers<\/a><\/li>\n<li><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2016\/04\/01\/enhance-customer-interaction-with-sage-300-and-salesforce-com-integration\/\" target=\"_blank\" rel=\"noopener\">Enhance Customer Interaction with Sage 300 and Salesforce.com Integration<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Salesforce has reimagined the platform from Classic to Lightning. With the lightning version, accessing data and tools has become easier. The major advantage of Salesforce Lightning over Salesforce Classic is its faster response time with enhanced user interface. Lightning uses its own set of components and design system which is different from Salesforce Classic. The\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/salesforce\/2017\/03\/27\/add-lightning-components-to-visualforce-page\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[205,206,207,208,214,215,448,518,523,526],"class_list":["post-2389","post","type-post","status-publish","format-standard","hentry","category-salesforce-srv","tag-lighning-app","tag-lightning","tag-lightning-basics","tag-lightning-component","tag-lightning-to-vf-page","tag-lightning-to-visualforce-page","tag-sf-lightning","tag-vf-component-in-lightning","tag-visualforce-code","tag-visualforce-page"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/comments?post=2389"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2389\/revisions"}],"predecessor-version":[{"id":10916,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/posts\/2389\/revisions\/10916"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/media?parent=2389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/categories?post=2389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/salesforce\/wp-json\/wp\/v2\/tags?post=2389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}