The url of the lightning component that i could see is like "/lightning/cmp/c__LCMP_AddLeadLine?c__leadId=00Q1g000004qAR5"

But "component.get("v.pageReference").state.c__leadId" gives the output as "00Q1g000004HUEe" And "decodeURIComponent(window.location.search.substring(1))" gives the output as "c__leadId=00Q1g000004HUEe"

The ids are changing based the the previous lead opened. Looks like a cache or some wierd salesforce issue. I have even tried disabling 'Enable secure and persistent browser caching to improve performance' in session settings and still the issue persists.

Can some one please help me here.

  • can you share your code where and how are you using it? – User6670 Mar 23 '20 at 12:55
  • I'm using a url button to redirect to a lightning component which has been implemented using lightning:isUrlAddressable. The url button to redirect on lead is as : /lightning/cmp/c__componentName?c__leadId={!Lead.Id} And in the init method im trying to get the leadId using component.get("v.pageReference").state.c__leadId – Shivananda Yalpi Mar 24 '20 at 5:35
  • you can try using this <aura:handler name="change" value="{!v.pageReference}" action="{!c.doInit}" /> in action whatever method you have which run during initialization – User6670 Mar 24 '20 at 5:53
  • Thanks a lot. Its works on adding the line you mentioned. – Shivananda Yalpi Mar 24 '20 at 6:18

Your Answer

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

Browse other questions tagged or ask your own question.