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
Behzad Bahadori 18Behzad Bahadori 18 

How can I add Opportunity ID to another page reference

I am trying to pass opportunity Id from one class to another class and I thought of doing it through URL , but I dotn know how I can add that
Opport Id to this
 
PageReference opptyPage = new ApexPages.StandardController(opportunity).view();
  opptyPage.setRedirect(true);

  return Page.PBXOrdering + opptyPage;

 
Baktash HossainzadehBaktash Hossainzadeh
Hello Behzad,

I think you are trying to pass a parameter.

For your case try this:
opptyPage.getParameters().put('id','insertIDHere');


Best regards,
Baktash Hossainzadeh