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
raj sfdc 8raj sfdc 8 

On account detail page ,if the new contact is saved it has to redirect to the account detail page saving the contact . how can we acheive this

On account detail page ,if the new contact is saved it has to redirect to the account detail page saving the contact . how can we acheive this
can please anyone help me.
Thanks in advance
Mohsinkhan PathanMohsinkhan Pathan
Hi ,

You can create a custom List button with content Source as Visualforce and use it. Create a Visualforce page and use PageRefrence in controller to redirect back to Account details page with the help of account.Id. Below is a example.

public PageReference New() {
       
        PageReference Acctdetail= new PageReference('/' + account.Id);
        return Acctdetail;
}

Hope this helps!

Regards,
Mohsinkhan