You need to sign in to do that
Don't have an account?
sfuser12
How to add cutom link in lightning component?
Hi,
I want to add custom link in lightning component instead of custom link or button.
Can any one tell how to add it in lightning component
Custom Link: https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDEfEAO/view?fv0={!Campaign.Id}
Thanks,
sfuser12
I want to add custom link in lightning component instead of custom link or button.
Can any one tell how to add it in lightning component
Custom Link: https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDEfEAO/view?fv0={!Campaign.Id}
Thanks,
sfuser12
I have done something like this and it it working in lightning component.
Lightning Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="myRecordID" type="String" default="ID hasn't been set yet!"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<a href="{!'https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDEfEAO/view?fv0=' + v.myRecordID}"
target="_new">View All Campaign Members</a> <br/>
<a href="{!'https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDAnEAO/view?fv0=' + v.myRecordID}"
target="_new">View Campaign Influence Report</a>
</aura:component>
Controller
({
doInit : function(cmp) {
cmp.set("v.myRecordID",cmp.get("v.recordId"));
}
})
00O1b000000VDAnEAO and 00O1b000000VDEfEAO will be your custom report ids.
All Answers
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
https://success.salesforce.com/answers?id=9063A000000pHDwQAM
https://salesforce.stackexchange.com/questions/156289/custom-links-to-generate-dynamic-reports-in-lightning
https://releasenotes.docs.salesforce.com/en-us/spring17/release-notes/rn_rd_reports_filter_url.htm
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
I have created custom link and it is working too. My headache is adding it into lightning component as a link.
Thanks,
sfuser12
I have done something like this and it it working in lightning component.
Lightning Component
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:attribute name="recordId" type="String"/>
<aura:attribute name="myRecordID" type="String" default="ID hasn't been set yet!"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<a href="{!'https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDEfEAO/view?fv0=' + v.myRecordID}"
target="_new">View All Campaign Members</a> <br/>
<a href="{!'https://dfsco--sync.lightning.force.com/lightning/r/Report/00O1b000000VDAnEAO/view?fv0=' + v.myRecordID}"
target="_new">View Campaign Influence Report</a>
</aura:component>
Controller
({
doInit : function(cmp) {
cmp.set("v.myRecordID",cmp.get("v.recordId"));
}
})
00O1b000000VDAnEAO and 00O1b000000VDEfEAO will be your custom report ids.
Here's a complete example of how to create a custom link in a Lightning Component by using LWC:
Create a New Lightning Web Component:
customLinkExample.html
customLinkExample.js Furthermore, if you are in search of a comprehensive guide on creating custom links in Salesforce Classic, I recommend visiting the website https://arrify.com/custom-links-in-salesforce-classic/. This guide provides step-by-step instructions for creating custom links in Salesforce Classic while following to best practices.