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
rbkrbkrbkrbk 

New button override does not auto-populate the master detail field with the parent object

This was asked before and answered with a URL hack that does not work in Lightning. 

I created a new Custom Object called “LOA Onboard”. I have overridden the New button for "LOA Onboard" with a Visualforce page that just sets a default value for the record Name so that it could be modified by a workflow rule. We have renamed the Account object to Client.

I created a Master-Detail field in LOA Onboard called Client and listed Account as the Parent. I created a new LOA Onboard record from the Related List in an Account instance. The Client field is not automatically populating with the Parent.If a revert the New button to default then auto-populate works.  I am attaching the relevant screen shots. How can I rewrite the VF page to fix this?

Client Field Definition:
Account Field Definition
Visualforce Page Override:
VF Page to replace the New Button

The Override settings:
User-added image