I have Order form,where there are 3 types of Orders(OrderScan,OrderFill,OrderGet) for each of these i have created Visualforce Page for new Orders(By Overriding New button).Based on these Record types i am redirecting to perticular VF page.

Now i am facing a problem for overriding Edit Button.I have also created 3 VF page for Editing now i should redirect to perticular Edit VF page based on RecordID.How can i do this..?Please help

Thanks in Advance

1 Answer 1


You could achieve this by using the action propriety of apex:page

Create a new Visualforce page with only this line

<apex:page standardController="Order__c" action="{!URLFOR(CASE(Order__c.RecordType.Name, 'OrderScan', '/apex/vfp1' ,'OrderFill','/apex/vfp2', '/apex/vfp3'))}" >
    <apex:variable value="{!Order__c.RecordType.Name}" var="recTypeName"/>

override your edit button with this new page.

Don't forget to change the condition and the urls and to add your standard controller (SObject you want to override the Edit button for it) :)

  • thanks for reply.Here what could be the value for 'value1' and 'value2'. Apr 20, 2014 at 10:50
  • What are the possible values for the RecordID? Apr 20, 2014 at 11:38
  • Order will have more records..as i mentioned in the question i have three different orders,i want to customize the edit screen for these three orders.. Apr 20, 2014 at 12:09
  • so to differentiate theme you have a RecordType ? Apr 20, 2014 at 12:59
  • Yes i have order record type. Apr 20, 2014 at 13:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .