+ Start a Discussion
Rahul456Rahul456 

When I use Input File,How to call other visual force page

Hi,
 
    When I executed Input File Sample Usage given in Reference Document,page is redirecting to Documents object--detail   page layout.How to return to some VF Page(Named XYZ) when this sample Usage Code is executed instead of redirecting document detail page.
 
Please suggest me.
 
Thanks
Raj
 
ESES
One way to do it is to override the save method in the extension to return a different page-reference. Modified apex extension from the reference is pasted below. No change is required the the page,
Code:
/*** Controller ***/
public class documentExt {
// ** Keeping a reference to the standard controller to make it do most of the work **
ApexPages.StandardController controller;    
        public documentExt(ApexPages.StandardController controller) {
        this.controller=controller;
               Document d = (Document) controller.getRecord();
               d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents
         }        
// ** Overriding the save method **        
public PageReference save(){
controller.save();
return page.PageName;
}         
}

 Replace 'pageName' with the name of the VF page you want to navigate to.



Message Edited by ES on 09-22-2008 10:21 AM