[SalesForce] Is it possible to override a standard page layout in edit view with a custom visualforce page

Example: I have created New Case visualforce page for external users. After they create a case using this New Case page and try to edit the case, it displays the standard page layout in edit view. I want to be able to override this standard layout page and render a page that is exactly like my New case page. I cant customize the case Edit button as this will enforce my visualforce page for all users. I only want to render my visualforce Edit page for external users. Thanks.

Best Answer

yes it is.

go to Case --> buttons, link, Actions then find the Label "edit" and select the action edit. .. then you can override the std page with that vf one.

Now, say if you want to choose between a std page and the vf page? What you'd do is create a routing VF page. So, when the user clicks edit, he goes to the router. based on what ever criteria (i.e. ecternal user / internal user), he'll get sent to where he needs to go.

Example

if you need any paramaters from your previous page, you can get those via a referring page. you can make this call in your constructor to build your retURL for a cancel action, or if you need the referrinf record in any way

 //vf page
apex:page action={!router}>

 // in  controller

public pagerefernce getRouter()
    PageReference p ;   
    if ($UserInfo.getProfileId == '') <-- external profile{
        p = new PageReference(/apex/YourVFPage);
        }else{
        p = new PageReference('/'+this.case.id+ '/e?nooveride=1'
        }
    return p;
}
Related Topic