+ Start a Discussion

How to access to Salesforce object in Edit mode from Visualforce Page?

Hi Experts,
I would like to code for a new button in Visualforce Page that will direct me to an Opportunity (in Edit mode) with some fields automatically filled up using the information passing as parameters from my calling Visualforce Page. Please help!
Best regards,
Boi Hue
You can do a URL hack and just redirect to your edit URL. Your URL can look like this:


you'll have to get the right merge field for the Id you care about, and then use Firefox's Page Info Tool to find the form field names.

Look in the VF documentation how to do a redirect to a page reference and you're there.

Thanks Steve for your quick response!



How does this work when developing through a sandbox->prod deployment loop?  The values of fieldname and nextfieldname will be different between sandbox and prod for the same logical field.


I looked in APEX Describe methods but there doesn't appear to be any way to dynamically generate the field name from the metadata.