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
The new LearnerThe new Learner 

How Redirect to Contact Page

How can i redirect to the contact page , once the opportunity record get created. can anyone help me please.
 
/lightning/o/Opportunity/new?defaultFieldValues=Name={!Account.Name},ContactId={!Contact.Id}&backgroundContext=%2Flightning%2Fr%2FContact%2F{!Contact.Id}%2Fview

 
ANUTEJANUTEJ (Salesforce Developers) 
Hi,

There could be multiple ways to implement your scenario however one way is you could have a controller instead of a standard controller with the custom save function defined in the the an extension class.

Hope this helps and please close the thread by marking a best answer so that it would be useful for other in the future and also helps in keeping the community clean.

Regards,
Anutej
The new LearnerThe new Learner
Hi ANUTEj,

Actually its List button , its working fine only one thing is that i am not able to redirect to contact record, because i am creating opportunity record from the contact related list, once the opportunity get created it has to back to the original contact id, this is my requiment.
ANUTEJANUTEJ (Salesforce Developers) 
Oh so what you can do is you can get the current id from url and after creating oppertunity you can use pagerefernce with the base url and the id so that you can navigate to the previous link. This is one way I could think of.
The new LearnerThe new Learner
its just button , i havent used any kind of customisation(controller, extension controller ) over here neither i am looking to do , is this possible to do with this button if yes kindly let me know
ANUTEJANUTEJ (Salesforce Developers) 
Ah, I apologize for understanding the scenario differently, to my knowledge I don't think there is a standard way for addressing your implementation.
 
ayu sharma devayu sharma dev
Hello

I would suggest using the inline visualforce page on the Opportunity page. So when your opportunity creates it will first take you on Opportunity but as soon the inline visualforce page's Controller executes you can divert to the Contact page with Contact Ids present on the Opportunity. I haven't tried it. But I think it is better to give it a try than doing nothing.

I hope it helps. If you need any more help please let me know

Thanks and Regards
Ayush Sharma