销售团队希望机会对象上Salesforce中的功能是:当机会(特别是记录类型,“ Suite Rental”设置为Closed-Won)时,它将自动启动下一步,即表单页面(外部网址)。
我创建了一个简单的VF页面,在Details(详细信息)部分上带有一个按钮,将其带到表单,但是当更改字段时,他们正在推动自动启动页面的特定功能。我尝试添加更多的Javascript,但是我认为我缺少一些步骤,例如触发器,流程或流程生成器。
VF
<apex:page id="pg" StandardController="Opportunity" extensions="SuiteFormController" standardStylesheets="true">
<script>
function OpenPage(sourcePage){
if(sourcePage == 'suiteForm') {
var win=window.open('formstack.com','_blank');
win.focus();
}
}
</script>
<script type="text/javascript">
if(
"{!Opportunity.StageName}" === "Closed Won" and "{!Opportunity.RecordType}" === "Suite Rental"
){
window.open('formstack.com','_blank')
}
</script>
<apex:form >
<apex:actionFunction name="OpenPage" action="{!redirect}" reRender="pb">
<apex:param assignTo="{!Page}" value="" name="param1"/>
</apex:actionFunction>
<apex:pageBlock title="Suite Rental Form" id="pb">
<apex:pageBlockButtons >
<apex:commandButton action="{!redirect}" value="Suite Form" onclick="OpenPage('suiteForm'); return false;"/>
<br/>
Hello,{!$User.FirstName}
</apex:pageBlockButtons>
<apex:iframe id="theIframe" src="{!OpenPageURL}" scrolling="true"/>
</apex:pageBlock>
</apex:form>
</apex:page>
控制器
public class SuiteFormController {
public String Page {get; set;}
public String OpenPageURL {get; set;}
public SuiteFormController(ApexPages.StandardController controller)
{
Page = '' ;
OpenPageURL = '' ;
}
public PageReference redirect()
{
if(Page == 'suiteForm')
{
OpenPageURL = 'formstackform.com' ;
}
return null;
}
}
更改舞台时,似乎无法打开页面。我是否缺少控制器上的某些步骤?预先感谢您的任何建议