Critical Update Bug? “Add a Namespace Prefix to Query Parameters and pageReference.state Properties”

This critical update is breaking several of my lightning components that use the URL to receive parameters. It is stripping out parameters, however none of my fields or parameters are part of a managed package. They aren’t “query parameters”. Not sure why anything related to pageReferences would even affect my lightning components since I’m pretty certain the lightning framework doesn’t care about “pageReference.state” at all.

This feels like a bug to me. If I tell that to salesforce support (which I’m about to do anyway) they are going to tell me that I don’t have developer support. AKA, probably useless as is usually the case.

Here is an example of the URL that gets produced when I have the critical update off:

Here is clicking the exact same link with the update on:

So, a whole bunch of seemingly random parameters just get deleted upon navigation. Doesn’t seem like that’s something the update is supposed to do. Any thoughts? Anybody else having this issue?

Just realized – this isn’t a URL button like I thought. It’s housed in a lightning component on the lightning record page.


<aura:component implements="force:appHostable,force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >

<aura:attribute name="record" type="Account"/>

<force:recordData aura:id="accountLoader"

<div class="slds-box slds-theme_default">      
    <div class="slds-text-heading_small">
        Data Coordinator Panel

     <ui:button label="Create Store" press="{!c.gotoURL}" />


gotoURL : function(component, event, helper) {
    var a = component.get('v.record');    
    function fullEncode(str){
            // Put some special URL encoding in here since apostrophes explode the whole world
       return encodeURIComponent(str).replace(new RegExp('\'', 'g') , 'xxapostrophexx');

    var urlString = '/one/';
        urlString += '&ReturnRecId=' + fullEncode(a.fields.Id.value);
        urlString += '&Name=' + fullEncode(a.fields.Name.value);
        urlString += '&ParentId=' + fullEncode(a.fields.Id.value);
        urlString += '&Account_Type__c=' + fullEncode(a.fields.Account_Type__c.value);
        urlString += '&BillingCity=' + fullEncode(a.fields.BillingCity.value);
        urlString += '&BillingCountryCode=' + fullEncode(a.fields.BillingCountryCode.value);
        urlString += '&BillingPostalCode=' + fullEncode(a.fields.BillingPostalCode.value);
        urlString += '&BillingStateCode=' + fullEncode(a.fields.BillingStateCode.value);
        urlString += '&BillingStreet=' + fullEncode(a.fields.BillingStreet.value);
        urlString += '&ShippingCity=' + fullEncode(a.fields.ShippingCity.value);
        urlString += '&ShippingCountryCode=' + fullEncode(a.fields.ShippingCountryCode.value);
        urlString += '&ShippingPostalCode=' + fullEncode(a.fields.ShippingPostalCode.value);
        urlString += '&ShippingStateCode=' + fullEncode(a.fields.ShippingStateCode.value);
        urlString += '&ShippingStreet=' + fullEncode(a.fields.ShippingStreet.value);
        urlString += '&POS_Type__c=' + fullEncode(a.fields.POS_Type__c.value);
        urlString += '&Concept__c='+ fullEncode(a.fields.Concept__c.value);
        urlString += '&OwnerId=' + fullEncode(a.fields.OwnerId.value);
        urlString += '&Customer_Success_Manager__c=' + fullEncode(a.fields.Customer_Success_Manager__c.value);
        urlString += '&Sales_Rep__c=' + fullEncode(a.fields.Sales_Rep__c.value);

    var urlEvent = $A.get("e.force:navigateToURL");
      "url": urlString



When the critical update mentions query parameters it’s referring the the values in the URL after the ?, so BillingCity=, Sales_Rep__c=, etc. The terminology is a bit inconsistent, see this question for an extended discussion on the matter. So if anything the bug in this case is that it’s not stripping all your url parameters.

My guess is that this is intended to prevent components in a different name space from reading the content of URL parameters from components in different spaces. While it appears that merely including a double underscore in the parameter name works for you now, it’s likely that will get fixed in the future and everything will get stripped. In general the “default” namespace is indicated by c__, so I expect the correct way to do this — if you’re manually building the url — is to prefix each of you’re parameters with c__ and they won’t get stripped.

That said, in general you’d want to try and let Salesforce handle figuring out the URL structure for you, so if they change the URL structure or behavior in the future you’re component continues to work. In comparison in visualforce the “more” official way to nagivate to an account would be using the URLFOR method, i.e. <apex:outputLink value="{!URLFOR($Action.Account.View,}"/> as opposed to building the link yourself <apex:outputLink value="\{!account.Id}"/>.

I’m not much of an expert in lighting, but based on little digging I think you want to use lighting:navigation to accomplish this and pass through the attributes in PageReference.state as outlined in this answer

This can now be accomplished via lightning:navigation documented


The target/ to component must implement lightning:isUrlAddressable
interface and the source/ from component needs to include
lightning:navigation, generate URL for a given pageReference (in
this case to a custom component) and finally call the navigate
method with that pageReference.

Here is a sample:

Target/ To Component

Component – myTarget.cmp

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:hasRecordId,lightning:isUrlAddressable">
    <lightning:card iconName="standard:settings" title="Navigation Example">
        <lightning:formattedText class="slds-p-left_small" value="This is your target component."/>

Source/ From Component


<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes">
    <lightning:navigation aura:id="navService"/>
    <lightning:button label="Navigate to Target Component" onclick="{!c.navigate}" />

Controller JS

    navigate : function(component, event, helper) {
        var navService = component.find("navService");
        var pageReference = {
            "type": "standard__component",
            "attributes": {
                "componentName": "c__myTarget"
            "state": {}

Source : Link , Question Author : Jake Hebert , Answer Author : Ralph Callaway

Leave a Comment