[SalesForce] Lightning Component as a button

I have created a lightning component that opens as a popup which requires some input from the user using based on which he is redirected to an external link. All of this functionality works correctly and the lightning component is a quick action. But the issue is that the quick action gets added to the Chatter feed of that particular record.

Is there any way that this remains as a button. The chatter feed shows the page when we click on the feed. I have added the lightning component as a button but still has no effect. How can I disable it to be shown on chatter feed and instead show up as a button?

The case detail page has the button listed under "Salesforce Mobile and Lightning Experience Actions". The lightning component itself implements the below:

implements="force:lightningQuickAction,force:hasRecordId,forceCommunity:availableForAllPageTypes,flexipage:availableforallpagetypes"

Apart from this, with respect to the UI, I can see that there is a question raised exactly similar to this.

Lightning Component as Quick Action not showing beside the buttons

I do not see any solution provided to this question either. But I have a similar problem and the button in my scenario is also added to the case details page layout. It would be great to solve this nagging issue.

If there is an easy alternative to invoke this component through a regular button using a JS, that would also help a lot.

Thanks for any help!

Best Answer

This is a expected behaviour from salesforce when feed tracking is enabled for cases or work orders, the page-level action menu on those records contains only custom buttons and supported standard buttons. Quick actions appear on the Chatter tab.

workaround:-

So in order to not see the action in the feed on Case or Work orders object record, you need to disable the feed tracking for your case object.

Steps are

setup > feed tracking  > select case > disable it and save

Reference

Alternate option:-

You can create a visualforce page which does the same functionality as your Lightning component and creates a visualforce page button and then add it to the layout. It will give what you want without caring the feed tracking is enabled or not.

Related Topic