0

Problem: I have a requirement which says, need to open a modal window which opens on click of related list button and this modal needs to be a lightning component,As we cant open a lightning component from related list button I achieved this by embedding this lightning component in a Visualforce page and then including this page in the related list button and then selected the option to open in existing window, so right now what i am facing is that the modal component isn't opening as a popup rather than its opening in a separate tab within the service console.

Possible solution: I skipped the popup part and added it as a lightning quick action and it works fine.

What suggestion i am looking for: Is there a way to open a lightning component from related list button? If i am opening a visualforce page which has the modal component, is there a way to restrict it from opening it in a new tab instead open as a popup on existing record page layout?

1

My initial thought was to use a javascript button to inject a modal but that wont work with a lightning component.

A tiny bit of research pulled up this:

Lightning Alternatives to JavaScript buttons

Which goes into detail on how to avoid using JavaScript buttons - which ironically includes custom related list buttons - but it doesn't seem to cover your specific use case. It actually advises not using javascript buttons and using lightning component quick actions instead which you have said you tried and that it works but it doesn't provide the exact experience you're looking for.

The last thing I can think of is that you can hide the related list from your page and build a lightning component that looks and acts like the same related list. This will allow you to add a button that could then pull in your other component.

  • Thanks for the response, yeah creating a complete custom related list is one of the solutions I to thought of but that's a lot of customization comparatively and in our org we are trying to put customization to minimal, lets see if someone else have any thoughts on this. – Addy May 16 '18 at 18:36
  • After a lot of brainstorming Custom Related List is the only possible way to achieve this, that's the only solution with the limitations we have with related list. – Addy May 31 '18 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.