+ Start a Discussion
Biswajit SamantarayBiswajit Samantaray 

The onFullDetails function of the BoatDetail controller should fire the appropriate event to redirect the user to the boat’s default detail page, using logic in the controller. Please make sure you're usin

Biswajit SamantarayBiswajit Samantaray

Be hungry for knowing how to achieve, so please spend 1 hour of even if vain time in watching the UI, salesforce docs for solutions

Now we need to learn about navigation to different pages using lifhtning.
There are many ways, so first I would recommend you to go through the following two documents:

1.     https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_web_page.htm      (use the second one                                                                                                                                                                                                        <lightning:navigation>)

       It assumes that you added <lightning:navigation aura:id="navigationService" /> in your component markup.
      type: "standard__webPage",
      attributes: {
      url: 'http://salesforce.com'    // In the url part have like 

                                                   //  let boat = component.get("v.boat");  let boatId = boat.Id; let url = 'https://mindful-unicorn-alga4w-dev-                                                                       //   ed.lightning.force.com/lightning/r/Boat__c/'+boatId+'/view';

2.    https://salesforce.stackexchange.com/questions/117590/lightning-component-add-an-event-redirecting-to-a-record

On the controller side


navigateToRecord : function(component, event, helper)

{ var navEvent = $A.get("e.force:navigateToSObject");


"recordId": "00QB0000000ybNX",         //"recordId": component.get("v.objSobject").Id,

"slideDevName": "Detail"


navEvent.fire(); }


Thats a few of the ways you can navigate to different urls using lightning.

For this aura challenge you have to use the second way. But the challenge is not going to end there. You have to know if the platform supports that event or not. So basically you have to use truthy/falsy concept with navEvent in var navEvent = $A.get("e.force:navigateToSObject");  inside an <aura:handler name="init" .......> and set an Boolean type attribute value as true or false correctly and then use <aura:if> to display or not display that button in the Full Details button in the UI.   Even after all this I commited the silly mistake in writing the <aura:if> completely outside the <aura:set attribute="actions"> tag instad of just writing it outside the button.