0

I have a canvas app (iframe) working perfectly in SalesForce Classic. How do I integrate it into Lightning?

1

You use the force:canvasApp tag. The example from the documentation is:

<aura:component>
    <force:canvasApp developerName="MyCanvasApp" namespacePrefix="myNamespace" />
</aura:component>

Custom component you can use in any builder:


canvas.component

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:attribute name="namespace" type="String" />
    <aura:attribute name="developerName" type="String" />
    <force:canvasApp developerName="{!v.developerName}" namespacePrefix="{!v.namespace}" />
</aura:component>

canvas.design

<design:component>
    <design:attribute required="false" name="namespace" />
    <design:attribute required="true" name="developerName" />
</design:component>

Example Usage:

Example of canvas in builder


  • How do you enable that component in Lighting? – Rob Sep 9 '18 at 19:26
  • @Rob You write a custom component, then add it to a Lightning Page. You will need to add additional logic depending on exactly where you want to place the component. – sfdcfox Sep 9 '18 at 19:53
  • Can you provide a URL that steps a developer through the process? Its the 'add it to a Lightning Page' that is not documented, haven't found any docs yet. – Rob Sep 9 '18 at 19:55
  • @Rob Start here, I guess? developer.salesforce.com/docs/atlas.en-us.lightning.meta/… – sfdcfox Sep 9 '18 at 19:59
  • there is no mention of integrating a canvas app into lightning there. – Rob Sep 9 '18 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.