+ Start a Discussion
SamuSamu 

How to redirect the from lead detail page to oppertunity detail page after conversion...

Hi All,

 

 I am writting a trigger to auto convert  qualified lead to oppertunity .After conversion i need to redirect  to oppertunity detaiol page .I am creating a class like below

 

 

 

public class RedirectOpportunity{
 public static PageReference sendLink(String oppId){
          PageReference pageRef = new  PageReference('/' + oppId);
           pageRef.setRedirect(true);
          return pageRef;
   }
}

After this I m calling this method from trigger and passing the oppertunity Id into that class.

It is not redirecting Can any one help me please .

 

 

Thanks

Samu

bob_buzzardbob_buzzard

You can't do that - a trigger has no control over where the browser ends up (and it may not even be fired due to a browser update).  You'll need to write your own custom lead conversion code to achieve this I think.

SamuSamu

Hi ,

 

I am writting the code for convertion ,It  is working fine only I need to redirect  to the opportunity page which is converted from lead .I am passing that id from trigger also.

 

 

Thanks

Samu 

SamuSamu

Hey ,

I havewritten the code for conversion and it is working fine .The only requirment is to redirect  to th eoppertunity detail page and I am passing the converted oppertunity id to that method.

 

 

Thanks

Samu

bob_buzzardbob_buzzard

PageReferences only make sense in the context of a visualforce page - you'd carry out the conversion in an action method and that would redirect to the page for the new opportunity.