为什么列表视图按钮的 URLFOR() 函数在沙箱之间功能不同



我在列表视图按钮中使用 URLFOR(( 函数重定向到实现 lightning:isUrlAddressable 接口的闪电组件。作为 URLFOR(( 函数的一部分,我在第三个参数中传入了一些 URL 参数,一个是合并字段,另一个是静态字符串值:

{!URLFOR("lightning/cmp/c__MyComponent", null, [id=Related_Object__c.Id,sObjectName="My_SObject_Name__c"](}

这在我们的 DEV 沙盒(API 版本 45.0(中正常工作,但相同的配置在我们的 QA 沙箱(API 版本 46.0(中不起作用。

当我们的QA沙箱中单击列表视图按钮时,我注意到根本没有为"id"和"sObjectName"填充URL参数。我也通过在闪电组件中记录 PageReference 变量的值来确认这一点。

API 版本之间是否存在任何差异或可能导致此行为的其他问题?

根据 Summer '19 发行说明:

Add a Namespace Prefix to Query Parameters and pageReference.state Properties was a critical update in Winter ’19 and is enforced for the Summer ’19 release. This critical update resolves naming conflicts for query parameters between package components.

这样,上述查询参数至少需要使用默认命名空间"c__":

{!URLFOR("lightning/cmp/c__MyComponent", null, [c__id=Related_Object__c.Id,c__sObjectName="My_SObject_Name__c"])}

文档:https://releasenotes.docs.salesforce.com/en-us/winter19/release-notes/rn_forcecom_general_namespace_prefix_cruc.htm

最新更新