0

I am trying to display a lightning component as a button on the lightning record page in the highlights panel beside standard salesforce buttons. Is there any way to add custom component within highlights panel?

Note: Cant use quickaction feature due to modal dialog box popup.something like this

4
  • So you want to click on a button to display your component, but directly in the page, not in a modal ? Commented May 4, 2017 at 19:22
  • Yes that button when clicked would update a field and display success toast message . Commented May 4, 2017 at 19:30
  • the place where you indicate in the image is where all the SF1 and lightning actions go, are you open to putting the button right under that highlights panel? if you are open then it is possible to create a custom component and just throw it on the pagelayout.
    – Rao
    Commented May 4, 2017 at 20:36
  • @Rao Ya I was looking to see if we can put right beside the Sf actions/buttons. If there is no workaround then having the component right below highlights panel will be the only option I guess. Commented May 4, 2017 at 21:10

1 Answer 1

1

I don't think there is a perfect solution for now but you have several options:

  • You can make use of the Lightning Component Quick Action anyway and do something like this:
    • Your markup would just display a waiting message, like "Updating", why not with a spinning wheel. The idea is that with this solution you have to display a modal, so just display a waiting message for the user instead of a white modal
    • Do your update using your component, using JS Controller / Apex
    • Fire both force:closeQuickAction and force:showToast events once your work is done. This will display your message in the Toast, and close the modal without any manual interaction from the user
  • Use a Visualforce page in a Detail Page Button, this will redirect you for maybe 1 second to a white page, Apex Controller will do the work and redirect back to your record with a PageReference. You won't be able to show the toast though.
  • Use a custom button that you'll put on your page through AppBuilder. You'll be able to do what you want but the button will be somewhere else on the page, so it might be confusing for users.
4
  • Appreciate your inputs. Could you please elaborate on the first point you mentioned please. Commented May 5, 2017 at 14:55
  • I've added a few details, tell me if it's enough. Commented May 5, 2017 at 15:42
  • Yes that's makes more clear. Is there a way we could have the standard button displayed on highlights panel can be morphed in to custom lightning component? If yes then that would be great help and resolve my problem. Commented May 5, 2017 at 16:04
  • You can't replace a standard button with a Lightning Component for now. The only way to use a Lightning Component in the standard list of button is to display it through the modal. Commented May 7, 2017 at 14:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .