如何将 vf 页面重定向到标准记录创建页面

问题描述 投票:0回答:1

这是我的代码,我在其中创建了一个按钮,该按钮放置在相关列表上,单击该按钮时我希望弹出警报,然后根据机会定向到标准记录创建表单

> `
> <apex:page standardController="Special_Pricing_Request__c" recordSetVar="Special Pricing Requests">
>  <apex:outputPanel >
>     <apex:outputPanel rendered="true">
>             <script>
> alert('Please ensure that the opportunity product for the opportunity is Updated.');
> window.location.href =" ";
>               </script>
>     </apex:outputPanel>
> </apex:outputPanel>
> </apex:page>
> ````
                                        

I dont know if i have to create a whole create record form which is too lengthy or i use lwc to call create record 
visualforce
1个回答
0
投票

在网上搜索 URLFOR 和“url hacking”、“url prepopulation”关键字。

https://help.salesforce.com/s/articleView?id=sf.customize_functions_urlfor.htm&type=5

Visualforce 中有特殊的

$variable
操作:https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_action.htm,您需要
$Action.Opportunity.New

这也是一个不错的教程(尽管 Classic 和 Lightning UI 之间的“url hacking”略有不同):https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/ 或者如果您更喜欢 SF 帮助:https://help.salesforce.com/s/articleView?id=release-notes.rn_general_lex_navigate_to_record_dfv.htm&release=224&type=5

© www.soinside.com 2019 - 2024. All rights reserved.