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: https://hs--deviv.lightning.force.com/lightning/n/RecordCreatePage?Object=Account&RecTypeId=01241000000VE0hAAG&ReturnRecId=0013C000009sJ9NQAU&Name=Test2018-09-28&ParentId=0013C000009sJ9NQAU&Account_Type__c=Franchise&BillingCity=Austin&BillingCountryCode=US&BillingPostalCode=78701&BillingStateCode=TX&BillingStreet=123%20Some%20Street2018-09-28&ShippingCity=Austin&ShippingCountryCode=US&ShippingPostalCode=78701&ShippingStateCode=TX&ShippingStreet=123%20Some%20Street2018-09-28&POS_Type__c=a0F3C0000007OyoUAE&Concept__c=a033C000001LHOGQA4&OwnerId=00541000000k4fPAAQ&Customer_Success_Manager__c=null&Sales_Rep__c=null
Here is clicking the exact same link with the update on: https://hs--deviv.lightning.force.com/lightning/n/RecordCreatePage?Account_Type__c=Franchise&POS_Type__c=a0F3C0000007OyoUAE&Concept__c=a033C000001LHOGQA4&Sales_Rep__c=null
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.
Component:
<aura:component implements="force:appHostable,force:lightningQuickActionWithoutHeader,flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >
<aura:attribute name="record" type="Account"/>
<force:recordData aura:id="accountLoader"
recordId="{!v.recordId}"
layoutType="FULL"
targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}"
targetError="{!v.recordError}"
/>
<div class="slds-box slds-theme_default">
<div class="slds-text-heading_small">
Data Coordinator Panel
</div>
<br/>
<ui:button label="Create Store" press="{!c.gotoURL}" />
</div>
Controller:
({
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/one.app#/n/RecordCreatePage?Object=Account&RecTypeId=01241000000VE0hAAG';
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");
urlEvent.setParams({
"url": urlString
})
urlEvent.fire();
}
})
__c
, total hack, but if you added __c to the rest of your parameter names seems like it might just avoid whatever is causing the other parameters to get stripped ... – Ralph Callaway Oct 24 '18 at 20:52Zuora__Subscription__c
, could see it just being a poor implementation of stripping the parameters that aren't managed packages (i.e.[^_]*__.*
is managed package, but they're doing.*__.*
) – Ralph Callaway Oct 24 '18 at 21:35