我正在处理web2lead表单,该表单在提交后更新记录。我将web2lead转换为visualforce页面,并且我尝试使用标准控制器扩展来在提交时更新记录。但我得到一个无效的页面重定向错误,我认为这是因为顶点表单没有提交到正确的URL。以下是我的代码:
VF:
<apex:page standardController="SVMXC__Service_Order__c" extensions="BEC_Web2LeadExtension" docType="html-5.0">
<apex:form html-action="https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" html-method="POST">
<apex:commandButton value="submit" action="{!submitAndUpdate}"/>
</apex:form>
</apex:page>
扩展方法:
public void submitAndUpdate(){
//controller.save();
SVMXC__Service_Order__c woRecUpdate = [select id, Submit_lead__c from SVMXC__Service_Order__c where Submit_lead__c = true and id=: woRec.id];
if(woRecUpdate != null){
woRecUpdate.Submit_lead__c = false;
update woRecUpdate;
}
所以我的问题是如何将表单提交到网址并更新表单提交的记录?
提前感谢您的帮助!