0

I'd like to be able to screen pop a record (that has my lightning app builder page associated with it) and have my custom components on that page read query parameters off the screen popped records URL.

I have tried the following for popping the record

var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
   "url": "/lightning/r/Contact/003S000001MOoR8IBL/view?dynamicId=" + id
});
urlEvent.fire();

and reading it in the component embedded in the record page using

window.location.search // returns undefined, dynamcidId=... expected

Unfortunately this returns 'undefined' as the query parameters weren't passed along. If I can't use query parameters is there another mechanism I can achieve this with?

There is some JS that will be invoking this screen pop and only it will know what data belongs to the screenshot. This data can't be configured ahead of time using the design attributes of the lightning component. I think.

Thanks for the help!

0

For Aura, use lightning:hasPageReference to gain access to the page parameters through the pageReference state. For LWC, use lightning-navigation. I'm not going to include all the details here, since you've tagged both types of components, but the general idea is that you'll get a value via an attribute or wired method that includes the state, and this state will include all of the page parameters in the URL. Examples are in the documentation.

| improve this answer | |
  • Thank you for responding but using lightning-navigation the query parameters are not passed along with the page reference. – carson Jul 3 at 16:31

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.