• The Ryan Larson
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
We're currently in the process of moving to a custom Lead Convert button. I've created a Visualforce page that the button calls to, and while it works in sandbox, when I try to execute it in Production, this error comes up:
 
Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}' in page leadconvert

Currently, I'm just having the custom button check a box so that it can stop any time-based flows, however I'll later be making it replace the Lead Conversion page altogether. I did a Visualforce page so that I could use it in Lightning and Classic as we are moving to Classic next month. Any help is appreciated:

Here is the VF page:
<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>

Thanks!
I apologize in advance, I am very new at Apex development and am just starting out down the SFDC Dev path, however I do have quite a bit of coding background. My question is, I'm embedding an iframe into a VF page that will show an Account creation page from our own backend and if possible, I'd like to pass through a few field values from the Account Record that the VF page lives on (Account Name, Phone number, etc) to the backend site that the iframe is showing.

Is it possible to pass through these values and if so, how best to go about that in Apex? Thank you so much!
We're currently in the process of moving to a custom Lead Convert button. I've created a Visualforce page that the button calls to, and while it works in sandbox, when I try to execute it in Production, this error comes up:
 
Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Lead.Convert, lead.id, [retURL=$CurrentPage.parameters.retURL], true)}' in page leadconvert

Currently, I'm just having the custom button check a box so that it can stop any time-based flows, however I'll later be making it replace the Lead Conversion page altogether. I did a Visualforce page so that I could use it in Lightning and Classic as we are moving to Classic next month. Any help is appreciated:

Here is the VF page:
<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>

Thanks!