I have a lightning component in which I wnat to make a link that redirect to an object record :
<aura:iteration var="a" items="{!v.actualites}">
<a href="{! a.Id}" data-id="{!a.Id}" style="text-decoration:none;" target="blank"> an image here </a>
</aura:iteration>
the problem is that when I click the image, the rediction does not work because I got the url : https://mysite.salesforce.com/c/a0o4E0000004EaKQAU And I want the url : https://mysite.salesforce.com/a0o4E0000004EaKQAU so I need to suppress the "/c" ...
I don't know how to do that... Maybe I need to declare a string in my apex controller wich contain the right url but how can I get it in my component ?
I create a function in my apex controller :
public static String getDebutUrl(){
return URL.getSalesforceBaseUrl().toExternalForm();
}
but I don't know how to retrieve the string in the js controller of my component
force:navigateToSObject