0

I have a lightning component with an iframe inside it and it sets the url for the visualforce pages controller. Everytime i deploy to a new org i have to go into the lightning component and change the iframe url though. Is there a way to have one URL that will work for all orgs?

Lightning Component:

<aura:component controller="ServiceReport_Helper" implements="lightning:isUrlAddressable,lightning:actionOverride,force:hasRecordId,force:lightningQuickActionWithoutHeader">
    <aura:attribute name="EmailModal" type="boolean" default="false"/>
    <aura:attribute name="showReport" type="boolean" default="true"/>
    <aura:attribute name="FileNameModal" type="boolean" default="true"/>
    <aura:attribute name="fileName" type="string" default=""/>
    <aura:attribute name="fromEmail" type="string" default=""/>
    <aura:attribute name="toEmail" type="string" default=""/>
    <aura:attribute name="ccEmail" type="string" default=""/>
    <aura:attribute name="subject" type="string" default=""/>
    <aura:attribute name="body" type="string" default=""/>
    <aura:attribute name="files" type="ContentDocument[]"/> 
    <aura:html tag="style">
        .slds-modal__container{
            max-width: 90rem !important;
            width:70% !important;
        }
    </aura:html>
    <aura:if isTrue="{!v.showReport}">
        <div class="slds-modal__content slds-p-around_medium">
            <iframe src="{! 'https://sf--sandbox--c.visualforce.com/apex/ServiceReport?Id=' + v.recordId }" 
                    width="100%" 
                    height="730px;" 
                    frameBorder="0"/>
        </div>
    
    <div class="slds-modal__footer">
        <lightning:button variant="brand" 
                          label="Create Service Report"
                          onclick="{!c.EnterFileName}"/>
        <lightning:button variant="brand-outline"
                          label="Close"
                          onclick="{!c.CloseModal}"/>
    </div>
    </aura:if>
    
    
    <!--     File Name Modal     -->
    <div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="FileNameModalbox" class="slds-modal">
        <div class="slds-modal__container">
            <div class="slds-modal__header">
                <h2 id="header43" class="slds-text-heading--medium">Service Report Name</h2>
            </div>
            <div class="slds-modal__content slds-p-around--medium">
                <div>
                    <ui:inputText label="Enter File Name" value="{!v.fileName}"/>
                </div>
                <br/>
                <lightning:button variant="brand"
                          label="Save"
                          onclick="{!c.Create}"/>
                <lightning:button variant="brand-outline"
                          label="Cancel"
                          onclick="{!c.CloseFileName}"/>
            </div>
        </div>
    </div>
    <div class="slds-backdrop " aura:id="FileNameModalbackdrop"></div>
    
</aura:component>
2
  • Did you try to make it relative and do {! '/apex/ServiceReport?Id=' + v.recordId }?
    – kurunve
    Jan 12, 2021 at 20:09
  • oh that works, thanks. don't know why it even recommended using the entire url
    – ThatGuy
    Jan 12, 2021 at 20:53

0

You must log in to answer this question.

Browse other questions tagged .