function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Invalid parameter for function URLFOR



i am trying to override the new button for Opportunity so when user save the opportunity he is redirected to a custom VF page.

but when i create an new opportunity and select an record type i am getting Error due to URLFOR method, below is code as well as error message.


Visualforce Error:

Invalid parameter for function URLFOR

Error is in expression '{!URLFOR($Action.Opportunity.Edit,, [saveURL='/apex/oppRedirect', retURL='/', cancelURL='/'], TRUE)}' in component <apex:page> in page oppurl


<apex:page standardController="Opportunity">
<script>"{!URLFOR($Action.Opportunity.Edit,, [saveURL='/apex/oppRedirect', retURL='/', cancelURL='/'], TRUE)}");

The expression seems fine, Please override the edit button on opportunity with this vf page and edit any existing opportunity. You will see it's working perfectly fine.




Visit My Blog here


That did work but the thing that  I want to achieve is when user saves the opportunity he should be redirected to my custom VF page :  oppRedirect.

That the reason I need to override the opp new button.