We are overriding a New button standard action with a VF page, this is getting called from a related list which is a lookup to the child.On the related VF page controller, we are trying to access the parent record if using below snippet
And also tried below snippet
In both the cases when we call this action from lightning we are getting null as a return, but when we tried same in classic it is working fine, surprisingly for system admin profile, this is working even in lightning.
As already this snippet is working perfectly in classic this cannot be a permission issue on remaining profiles.
Is there any other way we can access parent record id in standard controller's extension class?