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

  ID parentID=(String)controller.getRecord().get('Parent_Record__c')

And also tried below snippet

  ID parentID=((ChildRecord)controller.getRecord()).Parent_Record__c)

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.