You need to sign in to do that
Don't have an account?
JohnDurai
How to use URL i iframe src without hardcoding Aura Component
Hi All - I am trying to embed external web page in Salesforce Account record page using Aura component, I am trying the below approach which is working for me but need better way without harding the URL and passing the account id as well. can some one help me out on this.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<iframe src="https://externalwebpage?id=XXXXXX"
width="100%"
height="500px"
sandbox="allow-same-origin allow-scripts allow-forms"
scrolling="auto"/>
</aura:component>
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
<iframe src="https://externalwebpage?id=XXXXXX"
width="100%"
height="500px"
sandbox="allow-same-origin allow-scripts allow-forms"
scrolling="auto"/>
</aura:component>
You can use Custom labels to store the base URL and then concatenate it with the recordId.
Something similar :
<iframe src= "{!$Label.c.labelName + '?=' + v.recordId}"
width="100%"
height="500px"
sandbox="allow-same-origin allow-scripts allow-forms"
scrolling="auto"/>
All Answers
You can use Custom labels to store the base URL and then concatenate it with the recordId.
Something similar :
<iframe src= "{!$Label.c.labelName + '?=' + v.recordId}"
width="100%"
height="500px"
sandbox="allow-same-origin allow-scripts allow-forms"
scrolling="auto"/>
Aura component allows direct access of labels in HTML file hence you can use them as per your need. In case you have to perform complex computation using these labels then it would be recommended to use attribute and compute its value on the controller layer of the component.