You need to sign in to do that
Don't have an account?
Bert Van Hove
getrecord() returns NULL in Lightning
Hi guys,
i'm working on a project where I use a visualforcepage, a standardcontroller for opportunity and extend it with an apex class.
The apex class gets the AccountId from the current Account via getRecord().
This works perfect in Classic mode, but in Lightning getRecord() returns NULL.
Any ideas?
Thanks in advance
i'm working on a project where I use a visualforcepage, a standardcontroller for opportunity and extend it with an apex class.
The apex class gets the AccountId from the current Account via getRecord().
This works perfect in Classic mode, but in Lightning getRecord() returns NULL.
Any ideas?
Thanks in advance
The Apex controller has no knowledge of the request that went to the browser, all it has is information that has been passed to the method call. You'll need to get the record in the lightning component, which is what the 'force:hasRecordId' interface is for:
https://developer.salesforce.com/blogs/developer-relations/2015/11/building-context-aware-lightning-components.html
https://developer.salesforce.com/forums/?id=906F0000000BawjIAC
Best Regards,
Sandhya
All Answers
The Apex controller has no knowledge of the request that went to the browser, all it has is information that has been passed to the method call. You'll need to get the record in the lightning component, which is what the 'force:hasRecordId' interface is for:
https://developer.salesforce.com/blogs/developer-relations/2015/11/building-context-aware-lightning-components.html
https://developer.salesforce.com/forums/?id=906F0000000BawjIAC
Best Regards,
Sandhya
Thanks for your fast reply, i'm gonna try and figure out how to combine lightning components with the existing VFP, since I'm pretty new on these domains