I created a LWC Modal/Popup component, a simple modal window to display some text. This modal window has OK and Close buttons.

To test this modal/popoup I added a button to call it in the Record Page in Lightning App Builder and it works as expected. The modal/popup gets displayed and Record page cannot be navigated until the modal/popup is closed.

Now I would like to know if there is a way to add this modal/popup to the initialization of Record Page, so whenever and Account is opened that this modal/popup gets displayed first. And if the user clicks to close the modal/popup, the whole Record page should close.

Kind Regards, Safaas

1 Answer 1


You need to place the code that trigger the modal in a lifecycle hook : such as connectedCallback()

So your modal will show up when the user load the page for example.

You must log in to answer this question.

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