+ Start a Discussion
HNT_NeoHNT_Neo 

Create a link from a lightning component button to recent opportunity page in mobile

Hello,
I may have gone in the wrong direction on this but what I'm trying to do is when a user clicks a custom lightning component button (My Opportunities) it directs them to the Recent Opportunities page within Salesforce mobile. I've created a simple prototype in the URL below.

I created the component, but I'm not sure what the button syntax should look like. I want to use the lightning:icon I'm using as the button.

I had created a controller to an Apex class, but I doubt I need that if I just need a button of some sort to redirect the user to the Recent Opportunities. 

Please let me know what I need or need to modify. 

Thanks! 

 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" controller="MyOpportunityListController" access="global" >
    
    <aura:handler name="init" action="{!c.myAction}" value="{!this}" />
    <aura:attribute name="opportunity" type="Opportunity[]" />
    <ul>
        <aura:iteration items="{!v.opportunity}" var="opportunity">
            <li class="minli"> <h3>{!opportunity.Name}</h3> </li>
        </aura:iteration>
    </ul> 
    
<div class="slds-p-around_medium" style="text-align:center">
    <lightning:icon iconName="standard:opportunity" size="large" alternativeText="My Opportunities"/>
    <h3>Opportunities</h3>
</div>
</aura:component>



https://projects.invisionapp.com/share/5PNMNDF2U4N#/screens/314503251