Trailhead "Discover Lightning Actions" Hands-on Challenge - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Michelle MorrisseyMichelle Morrissey 

Trailhead "Discover Lightning Actions" Hands-on Challenge

Would someone be able to offer assistance with what I am supposed to do for the hands-on challenge for the 
Make the Move to Lightning Experience / Lightning Alternatives to JavaScript Buttons / Discover Lightning Actions unit? Do you have to write your own code? All of the previous units had me copy and paste code in a specific location in an already-existing string, but with this challenge, it simply says to install a package (which I did) and add appropriate interfaces to the "quickContact" component. I have no idea where I would find that component or appropriate interfaces to add to it. Am I just way over my head here? Thank you!
Best Answer chosen by Michelle Morrissey
Caden HowellCaden Howell
Hi Michelle,

The Lightning Component that is installed in the package is not set to be visible/used by an action.
To do this, you need to open the Dev Console, navigate to quickcontact.cmp and insert the following highlighted in the screenshot before saving:

User-added image

These do two things:

1. force:lightningQuickAction
Adds the standard header as shown below:
(you can use force:lightningQuickActionWithoutHeader and the highlight part below will not show)
User-added image

2. force:hasRecordId
This provides record context.

Once you implement the piece of code and create the Action, you'll notice that the component has no place to input an Account for the Contact. force:hasRecordId ensures that the Lightning Component knows to associate the Contact to the Account that we were viewing when selecting the Action.

All Answers

BhavinBhavin (salesforce.com) 
Hi Michelle,

I would recommend logging a support case with our Trailhead team via: https://trailhead.salesforce.com/help for further assistance.

Thanks,
Bhavin
Susan AragonSusan Aragon
Michelle, I'm stuck in the same spot. Looks like the component gets created when you install the package, but when you try to create the Action, it says "No Lightning Component Quick Actions are available for your organization."
Ankit AroraAnkit Arora
I got stuck at the same place. I don't understand how to complete this challenge.

The Aura component must be named quickContact.
Add the appropriate interfaces to the quickContact component. (Hint: there are two.)
Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component.
Add the action to the Salesforce1 and Lightning Experience Actions section of the Account Layout page layout. Hint: you may need to hover over this section and click override the predefined actions to add the action to the section.
Caden HowellCaden Howell
Hi Michelle,

The Lightning Component that is installed in the package is not set to be visible/used by an action.
To do this, you need to open the Dev Console, navigate to quickcontact.cmp and insert the following highlighted in the screenshot before saving:

User-added image

These do two things:

1. force:lightningQuickAction
Adds the standard header as shown below:
(you can use force:lightningQuickActionWithoutHeader and the highlight part below will not show)
User-added image

2. force:hasRecordId
This provides record context.

Once you implement the piece of code and create the Action, you'll notice that the component has no place to input an Account for the Contact. force:hasRecordId ensures that the Lightning Component knows to associate the Contact to the Account that we were viewing when selecting the Action.
This was selected as the best answer
Michelle MorrisseyMichelle Morrissey
Thank you, Caden. Hopefully I will have some time soon to get back to it and try that out. I appreciate the feedback!
Michelle MorrisseyMichelle Morrissey
Hi Caden,
Being that I am not a developer, and don't ever use the Developer Console, how would I go about "navigating to quickcontact.cmp"? I am in the Dev. console, and tried re-installing the package (because I couldn't find the item you are referencing), but was told it was already installed. Thanks for any assistance you can give!
Caden HowellCaden Howell
Hi Michelle,

Happy to help.

If you are in the Dev Console, click File > Open Resource > 'search' quick > quickcontact.cmp

User-added image
After the above, you should be presented with the first screen in my initial comment (minus the 'implements' tag which you'll need to add in). Don't forget to save before navigating in Salesforce to the Action. You can do so by pushing Ctrl + S or File > Save when quickcontact.cmp is selected.

Let me know how you go.

Regards,
Caden
 
Michelle MorrisseyMichelle Morrissey
Caden,

That worked and I completed the challenge! Thank you SO much for your assistance!

Michelle
Caden HowellCaden Howell
Great! Glad I could help and congratulations on completing the challenge!

If you wouldn't mind marking the post as the 'Best Answer'. That way we can close off the question and create a history for other users who may find the info helpful.

Regards,
Caden
Serge SologubSerge Sologub
i have a problem with finishing this challenge. I got an error "The Action 'Quick Contact' with Name 'Quick_Contact' was not found on the Account object." - where I can check that Account object? What does it mean?
 
Mary GaughanMary Gaughan

Serge, 

Perhaps you have already completed this, but since I just made it through I thought I would answer. Once you have the package and edit the component in the developer console, you go into Account in your playground org. Go to the Account Object and click on Buttons, Links and Actions. Create a new Action with the Lightning component and then go to Layout and place it in the Mobile and Lightning Actions section. 
I hope this is helpful.
Mary

Jene T. FullerJene T. Fuller

Just completed this badge with the help of the community. 

While the trail lists the code behind the component there is a gap of "what should I do".  Was very happy that Michelle asked the question, that Caden bridged the gap with the clear steps and visual aids.  Also am grateful Mary's simplified explanation of the challenge recap. This community is very special. Thank you everyone.

Andrew KuharichAndrew Kuharich
I agree with Jene. This could be a very difficult module to complete if this is your first-go with code and/or using the Developer console. The guidance provided here was crucial. Thanks everyone!