3

What are the difference between Inline Visualforce page vs Canvas App vs Lightning app.

I'm looking to build an app that needs to inject UI inside detail page for an object. Should work for both custom and standard records. Should work for both classic and Lightning. Salesforce 1 support would be nice to have.

I see that my options are -

  1. Inline visualforce page
  2. Canvas app
  3. Lightning component

I would prefer to host the UI outside, thus canvas app might make sense over Lightning component. I need to get context data from Salesforce like logged in user, object type and object id. What should be the preferred path?

Are there any other options that I'm missing out?

2
  • do you want to develop some standalone application outside of the salesforce and insert it to the record detail page? will this app be used based on data that is not stored in salesforce? Feb 4, 2021 at 11:12
  • There is no standalone app for now. I'm starting with Salesforce. There will be in future. However, I do want to develop the app outside of Salesforce because, 1) Doing it in apex is harder, 2) Apex has limits in terms of API calls size and time. The app will store data outside of Salesforce.
    – vishesh
    Feb 5, 2021 at 3:34

1 Answer 1

4
+200

Based on your use case let's analyze PROS and CONS for each of the approaches

1. Canvas Based Approach

PROS

  • You can tweak the app to be used as a standalone app as well if needed to move it outside the Salesforce
  • You can control the deployment of your code and do not have to package the application to update the orgs. This is a huge advantage if you are planning to distribute your app to multiple users
  • There is a Canvas SDK available in JavaScript so you are not limited to code using Salesforce opinionated framework like LWC.
  • It's inside an iframe so you won't have to deal with Salesforce Locker services.

CONS

  • It is an iframe inside the Salesforce UI for both classic and Lightning Experience. Iframes have UI that's not so user friendly.
  • Because the URL loads in iframe there will be a difference in load times between the top frame and the iframe.

2. Visualforce Page

PROS

  • Works in classic UI well.

  • It is easy to use any third-party javascript libraries since no locker restrictions.

CONS

  • Extra work to make sure you can communicate between the lightning mainframe and the iframe. Lightning Messaging Service and Live Controllers are your friends.
  • Extra work to make it performant on SF1
  • Iframes in Lightning Experience.
  • Not a lot of innovation happening with Visualforce in general.
  • Extra work required if you want to make your app work outside salesforce later

If you go via the Visualforce route stay away from using standard visualforce markups and build using a UI framework like React or Vue.

3. Lightning Components

I suggest you choose Lightning Web Component Framework (LWC) here instead of Aura Components.

PROS

  • Lot of innovation planned in this space. Well supported for Lightning Experience and the component is not rendered in an Iframe.
  • Lots of base components provided out of the box
  • Easy Salesforce Data integration with excellent support for Apex.
  • You can use this outside Salesforce using LWC OSS

CONS

  • You will have to use the Lightning out to use this on the Visualforce page. Needs additional work.
  • Have some learning curve if you have not used it before.

If you plan to use with Salesforce Data always i think LWC is best bet based on where innovation is happening.

If you want to keep the app outside the Salesforce platform then Canvas will be a good choice. However, note that you can also use Salesforce Canvas with Lightning Web Component framework.

You must log in to answer this question.

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