Skip to main content

Hi All!

I'm 95% ready to move our first team to Lightning, I am however hung up on 1 issue.

 

Our use case is that we have a few action buttons, when clicked they popup a modal window and then open a URL to an external site such as google.com

 

I have managed to pass a static value as the url, and this works, however I need to be able to pass a value from the record into the url

 

this is what my controller and component looks like, can someone please please please advise how I can 

get the value Account_Nbr__c from the opportunity and pass this into the URL

 

SetPaymentController.js

({

 doInit : function(component, event, helper) {

    //Find the text value of the component with aura:id set to "address"

    var AccountNBR = component.find("v.Account_Nbr__c").get("v.value");    

    var address = '255 pitt street sydney nsw 2000';

    var urlEvent = $A.get("e.force:navigateToURL");

    urlEvent.setParams({

      "url": 'https://www.google.com/maps/place/' + address + AccountNBR

    });

    urlEvent.fire();

}

})

 

SetPayment.cmp

<aura:component implements="force:lightningQuickAction" >

<aura:dependency resource="markup://force:navigateToURL" type="EVENT" />

    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />

    Opening Page to Set Payment Plan.. <br></br>

    You can close this modal now

</aura:component>

4 commenti
0/9000