You need to sign in to do that
Don't have an account?
Andrew Hoban 6
LWC Navigate to a New Record Thats Created in Apex
Hi,
I have a lightning web component that when a button is clicked, an apex method is performed to create a record.
After the record is created within apex, is it possible to get the record id of the new record back into the LWC to be used as part of the NavigationMixin?
Any example would be appreciated.
Thanks
I have a lightning web component that when a button is clicked, an apex method is performed to create a record.
After the record is created within apex, is it possible to get the record id of the new record back into the LWC to be used as part of the NavigationMixin?
Any example would be appreciated.
Thanks
Yes you can pass the Id back to LWC.
Please refer the below sample and i have highlighted the important lines :
HTML:
JS:
Apex Class:
Thanks.
Maharajan.C
All Answers
Can you check the below stack exchange question with the similar requirement which is answered by expert.
https://salesforce.stackexchange.com/questions/305321/lwc-navigationmixin-navigate-after-creating-new-record-not-getting-id
If this solution helps, Please mark it as best answer.
Thanks,
Is it possible to pass the id back into the LWC?
Yes you can pass the Id back to LWC.
Please refer the below sample and i have highlighted the important lines :
HTML:
JS:
Apex Class:
Thanks.
Maharajan.C