You need to sign in to do that
Don't have an account?
Kiran Jain 15
Call Lwc when Record Update From Detail page
hello Peers,
I am stuck in a requirement. My requirement is that when any record is update from detail page then my lwc will call.
lwc is also on detail page.
If it were in aura, we could use force:recordData but in lwc it not works.
please anybody suggest me what should I do.
it's urgent for me.
Thank in advance
I am stuck in a requirement. My requirement is that when any record is update from detail page then my lwc will call.
lwc is also on detail page.
If it were in aura, we could use force:recordData but in lwc it not works.
please anybody suggest me what should I do.
it's urgent for me.
Thank in advance
Here is a sample code, that will show toast event message when the record is updated in account detail page.
In general, when the page is loaded , it wont fire, but whenever account is edited in detail page, the logic fires the toast event.
we can go with getRecordNotifyChange method, if record changed outside its mechanisms. But I understood, for your requirement, it is not required. we can use 'getRecords' method from uiRecordApi for your need.
Let me know if this helps you
Thanks
Surya G
All Answers
we can use ui-record-api in LWC to achieve your requirement.
There is a method called getRecordNotifyChange, that will help you yo execute the logic only when the record is modified.
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_get_record_notify
Thanks
Surya G
Thanks for response, I am using it but I'm not able to capture detail page event. can you give me any example there it's working fine.
it's really urget.
Thank you
Here is a sample code, that will show toast event message when the record is updated in account detail page.
In general, when the page is loaded , it wont fire, but whenever account is edited in detail page, the logic fires the toast event.
we can go with getRecordNotifyChange method, if record changed outside its mechanisms. But I understood, for your requirement, it is not required. we can use 'getRecords' method from uiRecordApi for your need.
Let me know if this helps you
Thanks
Surya G
Thanks a lot, Really it is helpful for me.You are worthy for best.