You need to sign in to do that
Don't have an account?
Kiran Kumar Gottula
URLFOR function in Action methods....
Hi folks,
please help out.
When I click on standard convert button on lead. i want to check the Cancel_Workflow__c check box field and updating it. after that it will navigate to standard lead convert page with auto update the opportunity name with some field in lead record. which is given below. while saving the vf page. i have some error message. am I miss anyhting?
Error : Error: Syntax error. Found '['
FYI:
<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("/lead/leadconvert.jsp", lead.id,
[&sem="1",&noopptt=Lead.FirstName, Lead.LastName - Lead.Departure_City_Leg_1__c-Lead.Arrival_City_Leg_1__c - Lead.Departure_Date_Leg_1__c,&IsReminderSet_fu="0"] , [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>
please help out.
When I click on standard convert button on lead. i want to check the Cancel_Workflow__c check box field and updating it. after that it will navigate to standard lead convert page with auto update the opportunity name with some field in lead record. which is given below. while saving the vf page. i have some error message. am I miss anyhting?
Error : Error: Syntax error. Found '['
FYI:
<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("/lead/leadconvert.jsp", lead.id,
[&sem="1",&noopptt=Lead.FirstName, Lead.LastName - Lead.Departure_City_Leg_1__c-Lead.Arrival_City_Leg_1__c - Lead.Departure_Date_Leg_1__c,&IsReminderSet_fu="0"] , [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>
<apex:page standardController="Lead" >
<apex:form >
<div style="visibility:hidden;">
<apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/>
{!lead.firstname}
{!lead.LastName }
{!lead.Departure_City_Leg_1__c}
{!lead.Arrival_City_Leg_1__c}
{!lead.Sys_Departure_Date_Leg_1__c}
</div>
<apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/>
<apex:actionFunction name="standardConvert"
action="{!URLFOR($Action.Lead.Convert, lead.id, [retURL=Lead.Id,sem="1",noopptt = Lead.FirstName + ' '+Lead.LastName +' - '+Lead.Departure_City_Leg_1__c+'-'+Lead.Arrival_City_Leg_1__c+'-'+Lead.Sys_Departure_Date_Leg_1__c,IsReminderSet_fu="0"], false)}" />
<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>
All Answers
2) do not use "" inside []
3) use [name1=value, name2=value2] format
4) the funntion can take only 4 arguments
<apex:actionFunction name="standardConvert"
action="{!URLFOR("/lead/leadconvert.jsp", lead.id, [sem=1,noopptt=Lead.FirstName, newparam=Lead.LastName - Lead.Departure_City_Leg_1__c-Lead.Arrival_City_Leg_1__c - Lead.Departure_Date_Leg_1__c,IsReminderSet_fu=0,retURL=$CurrentPage.parameters.retURL] , true)}" />
i have added paramname as newparam for Lead.LastName expresion.
<apex:page standardController="Lead" >
<apex:form >
<div style="visibility:hidden;">
<apex:inputField value="{!Lead.Cancel_Workflow__c}" id="cancelWorkflow" style="visibility:hidden; "/>
{!lead.firstname}
{!lead.LastName }
{!lead.Departure_City_Leg_1__c}
{!lead.Arrival_City_Leg_1__c}
{!lead.Sys_Departure_Date_Leg_1__c}
</div>
<apex:actionFunction name="quickSave" action="{!quickSave}" oncomplete="standardConvert();"/>
<apex:actionFunction name="standardConvert"
action="{!URLFOR($Action.Lead.Convert, lead.id, [retURL=Lead.Id,sem="1",noopptt = Lead.FirstName + ' '+Lead.LastName +' - '+Lead.Departure_City_Leg_1__c+'-'+Lead.Arrival_City_Leg_1__c+'-'+Lead.Sys_Departure_Date_Leg_1__c,IsReminderSet_fu="0"], false)}" />
<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>