I tried to do this and it works but only for the admin, I gave access to the Apex Classes to the profile of the user which cannot see the changes with the refresh, but still does not work
It didn't work for me the callBackFunction never called and refreshmydata() eventually not called either for my case. My usecase was my custom component is showin contact name and accountname and in contact name i have a type attribute link which opens current contact in a standard salesforce edit record as popup like normal standard behaviour. But even after save custom component didn't refresh... It's not a full proof solution i think. Please check..
hello thanks for the video, we are using this same workaround however we are hitting limits in terms of event listened. It seems that when all users have the component active, if one event is published all the users will receive it hence reaching limits super fast when you have undreds of user working at same time. Any idea on how to proceed ? thanks
Yes that's true as all the components will be listening to the same event. You can restrict user's event listening by checking for a specific permission assigned to users so that it won't trigger for all the users in the org... or we can also add filter to trigger the event on some specific field updates instead of having it for all field updates.
Hi is this the only way to check if a record is updated in detail using lwc. Is there any optimization available now. Thank you in advance
There are many ways to check if record is getting updated, are you looking for a specific scenario?
Thank you for sharing this ❤
You're welcome!
This is exactly the usecase i am working on, thanks mate for this work around🙌
Great, glad you like it 🙂
I tried to do this and it works but only for the admin, I gave access to the Apex Classes to the profile of the user which cannot see the changes with the refresh, but still does not work
Does your user has access to Platform Events as well?
@@SalesforceBolt I tried to look for that permission, but I could not find it, where is it?
It didn't work for me the callBackFunction never called and refreshmydata() eventually not called either for my case. My usecase was my custom component is showin contact name and accountname and in contact name i have a type attribute link which opens current contact in a standard salesforce edit record as popup like normal standard behaviour.
But even after save custom component didn't refresh... It's not a full proof solution i think. Please check..
Thanks for sharing this
Glad you like it!
What is solution if we are not using wire decorator to fetch records? In that case we can not use refreshApex
To refresh the cache while calling a method imperatively you can use notifyRecordUpdateAvailable(recordIds)
hello thanks for the video, we are using this same workaround however we are hitting limits in terms of event listened. It seems that when all users have the component active, if one event is published all the users will receive it hence reaching limits super fast when you have undreds of user working at same time. Any idea on how to proceed ? thanks
Yes that's true as all the components will be listening to the same event. You can restrict user's event listening by checking for a specific permission assigned to users so that it won't trigger for all the users in the org... or we can also add filter to trigger the event on some specific field updates instead of having it for all field updates.
Do we have any way to fire an event on standard flexipage tab change to reload a lwc component ?
Unfortunately for standard tab we don't have any event yet.
Empapi can do this i think.
Yes using emp api also you can subscribe to it.