0

I have a LWC Navigation component that is going to a custom tab that inturn loads a VF page, with params. This all works as expected and the url structure for the user is correct. However in the VF controller i was unable to get out my parameters. When i check the URL passed it looks to have become encrypted somewhere.

URL:

lightning/n/c__Schedule?c__startDate=2019-07-26&c__endDate=2019-07-31&c__load=0031h00000SEsycAAD&c__showPanel=true

Apex controller using ApexPages.currentPage().getUrl()

/apex/c__Scheduling?clc=0&isdtp=p1&ltn_app_id=06m1h0000005CsKAAU&nonce=a7702bebbb9a9b7dd79ac47e18112347003d1c73e7c0d28cdfca346fbb806d2c&sfdc.tabName=01r1h000000D2pX&sfdcIFrameHost=web&sfdcIFrameOrigin=https%3A%2F%2Fvelocity-computing-7152-dev-ed.lightning.force.com&tour=&vfRetURLInSFX=%2Fhome%2Fhome.jsp

Any thoughts on why this happens and how to get the parameters i need out?

0

Page is loaded in iframe in lightning so apex is giving you iframe url.

For achieving this, you need lightning component in tab inside which you can have iframe with src your vf page. Lightning component can read url parameters through pageReference when you implement lightning:isUrlAddressable. Then, component has to send the parameters to page. For this you need to establish communication between component and page using window messaging service. For that, you have to implement event listener in page and dispatch message event from component. For understanding how to implement this, refer How to print iframe in Lightning Component

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.