lwc-recipes
lwc-recipes copied to clipboard
wireListView receipe uses getListUi which is deprecated
Summary
The wireListView uses getListUi which is deprecated. I tried using the receipe, I see [object object] as output. https://developer.salesforce.com/docs/component-library/documentation/en/lwc/reference_get_list_ui
Salesforce Org Type
Developer Edition Org
Steps To Reproduce
Use the code as it is to create a lwc component. Deploy the component and add it to Home page.
Current Behavior
The output shown is [object object]
Expected Behavior
Listview data
Relevant Log Output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Welcome! 👋
Thank you for posting this issue. 🙇🏼♂️ We will come back to you latest within the next 48h (working days). Stay tuned!
Hi @manishgourpsl, Thank you for pointing this out. We will add a note in the code that this method is deprecated or hide the recipe while we are waiting for a replacement to geListUi(). We can use Apex for now to fetch the records. The recipe shows the results as expected(screenshot attached). Are you still facing the issue?
?
As of today, there is no exact replacement for getListUi. getListInfoByName only returns the list view's information/metadata, but doesn't return the records. As Satya mentioned, we will add a comment that the adapter is deprecated.
Any updates on this issue? It is annoying that the replacement adapter "getListInfoByName" does not return any records and it seems that there are no other adapters providing this functionality.
Hey @IvanSudakov and @manishgourpsl,
For the original issue -- I believe the code does work as intended but I notice it mentions copying the code to make an LWC component and not necessarily deploying the full lwc-recipes framework (which includes org metadata). The recipe for wireListView specifically references All_Recipes_Contacts list view dev name. If you make a Contacts list view and set the dev name to All_Recipes_Contacts it should load. You can also change the dev name in the code to point to a list view dev name you want to load. My guess is the [object object] is actually rendering the error object incorrectly (did you also copy c-error-panel and it’s dependencies?)
As @adityanaag3 mentions there is no replacement to getListUi yet. We knew we planned write a replacement so we marked it deprecated. We do have the replacement on our roadmap for 2024 as part of our framework upgrades to lists (#safeharbor).
For now the guidance is to continue using the deprecated wire as it is the only source of this data. We don’t plan to immediately delete it once the replacement arrives and there will be plenty of time to continue using it and consider migrating to the newer wire. It may also be that additional features to data fetching will only be available to the newer wire and not be backported to the deprecated one.