function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scott.DivishScott.Divish 

Lightning Alternatives to JavaScript Buttons

I'm truly not a developer, and yet a Trailhead lesson is requiring me to perform as such to complete it.  

The subject Trailhead lesson says to Create A Lightning Action.  I've downloaded the indicated installation package for quickcontact lightning component.  However, I don't know where to go with step 2 below.  I tried to glean the needed information from the lesson, but, again, I'm not a developer and don't understand all the code.  If someone could point me in the right direction...using declaritive verbage...I would greatly appreciate it.

Thanks,  Scott
_____________________________________________________
To complete this challenge, you need to add a Lightning component to your org. Then use that component to create a Lightning action on the Account object. When the action’s button is clicked, it creates a new contact based on form input. To get started, install this package that contains the component bundle that you'll need to modify.
1. The Lightning component must be named quickContact.
2. Add the appropriate interfaces to the quickContact component. (Hint: there are two.)
3. Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component.
4. Add the action to the Account Layout page layout.
Best Answer chosen by Scott.Divish
SaraHasNoLimitsSaraHasNoLimits
Hi Scott,

The only reason I have seen for the component not to be listed is if you did not implement the interface for the force:lightningQuickAction in your actual Lightning component. Basically, it was step 2 where it said: Add the appropriate interfaces to the quickContact component. (Hint: there are two.)

What you will need to do is this (assuming you have sucessfully installed the package as directed)

1.) Open Developer Console
2.) Go to File - Open Lightning Resources
3.) Locate the component that was installed named quickContact
4.) Add the following code to the aura:component tag: implements="force:hasRecordId,force:lightningQuickAction"
5.) Go to File - Save and make sure it saves ok.
6.) Go back to your instance of developer org and pull back up the Action. You may have to do a refresh, but it should be there if you implemented the force:lightningQuickAction interface.

Hope that helps

All Answers

Amit Singh 1Amit Singh 1
Hello Scott,

Follow the below steps.

1) Goto Setup->Object Manager -> Account -> Click on "Button Links and Action" -> New Action.
User-added image

2) For lightning Component Select component "c:quickContact". Label as "Quick Contact" click on Save.
User-added image

User-added image

3) Got to Account layout Click on Account Layout and add Quick Action to Account lay out. Click on Salesforce1  & Lightning Action. then add Quick Contact to the page layout.(If you do not find a way to add action then click on wrench icon you will see all the quick action)
User-added image
4) Open Account record which Will look like below. 
User-added image

Let us know if this helps:)

Thanks!
Amit Singh
Scott.DivishScott.Divish
Amit, thanks for the reply.  I’ve actually tried all this.  However, when I try to create the new action I can’t find the lightning component “c:quickContact”.  Below is the error I get when trying to find it:

User-added image

Yes, I did load the package per the instructions too.  Here is the quickcontact component in my DEV org:

User-added image
What concerns me is that even though the package is installed and the component is available, why isn’t it showing as available when creating the New Action.  I’m assuming there is some code that needs to be completed.  Not being a developer…I don’t’ know.
Thanks,

Scott
SaraHasNoLimitsSaraHasNoLimits
Hi Scott,

The only reason I have seen for the component not to be listed is if you did not implement the interface for the force:lightningQuickAction in your actual Lightning component. Basically, it was step 2 where it said: Add the appropriate interfaces to the quickContact component. (Hint: there are two.)

What you will need to do is this (assuming you have sucessfully installed the package as directed)

1.) Open Developer Console
2.) Go to File - Open Lightning Resources
3.) Locate the component that was installed named quickContact
4.) Add the following code to the aura:component tag: implements="force:hasRecordId,force:lightningQuickAction"
5.) Go to File - Save and make sure it saves ok.
6.) Go back to your instance of developer org and pull back up the Action. You may have to do a refresh, but it should be there if you implemented the force:lightningQuickAction interface.

Hope that helps
This was selected as the best answer
Scott.DivishScott.Divish
Thanks for the input.  I attempted to do as you instructed and I'm getting an error when adding the code to the aura:component tag.  Maybe I'm doing it wrong.  Here is the code, followed by the Field Integrity Exception error I get when I try to save.
User-added image

User-added image

Thanks,

Scott
Scott.DivishScott.Divish
Nevermind...I forgot a " at end of line.  It's all good now. Thank YOU!