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
Subha SavithriSubha Savithri 

Editing Vf Page

I am new to salesforce and i face a problem.
My problem is I want to redirect to the same visualforce page when New and Edit button is clicked from another Vf page.
Is it possible to change the Page Heading as "Add Request" when clicking Add and "Edit Request" when clicking Edit button? Please help
gthawg76gthawg76
You should be able to do something like this in your controller:
 
public PageReference editRecord(){
    //doing a DML as well
    pageRef = new PageReference('/apex/NextPage');
    pageRef.setRedirect(true);
    pageRef.getParameters().put('pageHeader','Edit Request');
    return pageRef;
}

And then get the parameter in VF lkie this:
<apex:inputField value="{!$CurrentPage.parameters.pageHeader}"/>
Hope this helps!

 
Subha SavithriSubha Savithri
Thanks for your reply.
I get the below error in my Vf Page
Error: Field parameters does not exist. Check spelling. Can you please help on this?
Subha Ayyappan 7Subha Ayyappan 7
Can anybody please help me in this? Thank you.