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
Steven NsubugaSteven Nsubuga 

Custom Button created in Classic not working well with Lightning

A few years ago I created a Custom button on Account to create an Opportunity for that Account. On clicking the button, a visualforce page would load, showing some info and then when the user clicked ok, it would load the list of Opportunity record types, and after that would load the new opportunity detail page with the Account field prefilled. I used Apex and some URL hacking to prefill the Account field.
When we switched from Classic to Lightning, the Account field was no longer prefilled. It seems like way too much work to redo this feature from scratch using LWC which I am still learning. Any thoughts on how I can fix this? Everything else works but the Account field is no longer prefilled as before and this is a huge inconvenience to say the least. 
Best Answer chosen by Steven Nsubuga
David Zhu 🔥David Zhu 🔥
Classic button url hacking does not work in lighting. You may use the Lightining url hacking instead.
Please follow the instruction in the blog.
https://www.salesforceben.com/salesforce-url-hacking-for-lightning-tutorial/