Workaround: Refresh Custom LWC on Change of Data in Standard Components or Backend Updates in SFDC

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

Комментарии • 17

  • @ruchitham9487
    @ruchitham9487 Месяц назад +2

    Thank you for sharing this ❤

  • @Chitrapadi
    @Chitrapadi 6 месяцев назад +1

    This is exactly the usecase i am working on, thanks mate for this work around🙌

  • @penkogadzhev9805
    @penkogadzhev9805 2 месяца назад +2

    Thanks for sharing this

  • @guerrdev
    @guerrdev 2 месяца назад +2

    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

    • @SalesforceBolt
      @SalesforceBolt  2 месяца назад +2

      Does your user has access to Platform Events as well?

    • @guerrdev
      @guerrdev 2 месяца назад +1

      @@SalesforceBolt I tried to look for that permission, but I could not find it, where is it?

  • @vetealaurent3380
    @vetealaurent3380 5 месяцев назад +2

    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

    • @SalesforceBolt
      @SalesforceBolt  5 месяцев назад

      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.

  • @samirshaikh9201
    @samirshaikh9201 6 месяцев назад +2

    What is solution if we are not using wire decorator to fetch records? In that case we can not use refreshApex

    • @SalesforceBolt
      @SalesforceBolt  6 месяцев назад +1

      To refresh the cache while calling a method imperatively you can use notifyRecordUpdateAvailable(recordIds)

  • @yashsrivastava4803
    @yashsrivastava4803 6 месяцев назад +1

    Do we have any way to fire an event on standard flexipage tab change to reload a lwc component ?

    • @SalesforceBolt
      @SalesforceBolt  6 месяцев назад

      Unfortunately for standard tab we don't have any event yet.

  • @roysan896
    @roysan896 6 месяцев назад +1

    Empapi can do this i think.

    • @SalesforceBolt
      @SalesforceBolt  6 месяцев назад

      Yes using emp api also you can subscribe to it.