You need to sign in to do that
Don't have an account?
Jag Singh
Lead Conversion with Time-dependent Workflow through VF Page
Hi,
I was wondering if someone could kindly help with my code to convert a Lead when it has a time based workflow running against it.
1. Firslty, I worked from this blog in how to do it:
http://opfocus.com/blog/how-to-convert-a-lead-in-use-by-a-time-based-workflow-in-salesforce/
2. I'm not great with coding so wanted some guidance of why I'm getting the following error message when creating a VF page:
Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}' in page leadconversion
3. Code is as follows:
<apex:page standardController="Lead" >
<apex:form >
<div style="visibility:hidden;">
<apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/>
</div>
<apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/>
<apex:actionFunction name="standardConvert"
action="{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}" />
<script language="JavaScript">
var previousOnload = window.onload;
window.onload = function() {
if (previousOnload) previousOnload();
fixLead();
}
function fixLead() {
var elemCancelWorkflow = document.getElementById('{!$Component.cancelWorkflow}');
elemCancelWorkflow.checked = true;
quickSave();
}
</script>
</apex:form>
</apex:page>
4. My VF page URL is: https://c.cs18.visual.force.com/apex/LeadConversion
Any kind of help here would be amazing as this would be very beneficial for our company.
Thanks in advance,
Jag
I was wondering if someone could kindly help with my code to convert a Lead when it has a time based workflow running against it.
1. Firslty, I worked from this blog in how to do it:
http://opfocus.com/blog/how-to-convert-a-lead-in-use-by-a-time-based-workflow-in-salesforce/
2. I'm not great with coding so wanted some guidance of why I'm getting the following error message when creating a VF page:
Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}' in page leadconversion
3. Code is as follows:
<apex:page standardController="Lead" >
<apex:form >
<div style="visibility:hidden;">
<apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/>
</div>
<apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/>
<apex:actionFunction name="standardConvert"
action="{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}" />
<script language="JavaScript">
var previousOnload = window.onload;
window.onload = function() {
if (previousOnload) previousOnload();
fixLead();
}
function fixLead() {
var elemCancelWorkflow = document.getElementById('{!$Component.cancelWorkflow}');
elemCancelWorkflow.checked = true;
quickSave();
}
</script>
</apex:form>
</apex:page>
4. My VF page URL is: https://c.cs18.visual.force.com/apex/LeadConversion
Any kind of help here would be amazing as this would be very beneficial for our company.
Thanks in advance,
Jag
rather than way you using it.
PS: if this answers your question then hit Like and mark it as solution!
I'm not sure how this would help me? Any guidance?
Thanks,
J
Implement a method in a class like below Associate this controller as controller with your VF page and in <apex:page> tag there is property called "action" which you can set like below:
Make sure your URL of Page should have "Id" of Lead like /apex/myVFPage?id=xxxxxxxx
PS: if this answers your question then hit Like and mark it as solution!