LWC RefreshView API - Update Custom Component view from Standard View without Page Refresh

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • ✨ lightning/refresh module! ✨
    To leverage the power of the RefreshView API, simply import the lightning/refresh module into your LWC code. This module not only replaces force:refreshView for Aura components but also offers additional capabilities.
    With the lightning/refresh module, you gain access to:
    🔄 The RefreshEvent event: Now, your module can fire this event to indicate the need for a refresh. It's a handy way to trigger updates in your LWCs dynamically.
    🔧 Methods for registration: Components can register to receive the dispatched refresh event and kickstart the refresh process. This allows for seamless communication and synchronization between different parts of your Salesforce org.
    💡 Callback methods: You can register callback methods that are invoked during the refresh process. This enables you to perform specific actions or execute custom logic when the refresh event occurs.
    Code Available 0n - www.udemy.com/...
    #lwc #salesforce #dreamforce

Komentáře • 15

  • @sairamakanthlingaparthi4095

    Simply the timing u cover the topic is awesome and thanks for sharing the knowledge

  • @user-bm8lw9fk4f
    @user-bm8lw9fk4f Před 7 měsíci

    Thanks! Helped me a lot!

  • @MK72887
    @MK72887 Před rokem

    So it refreshes the custom component when another field other than the Rating is changed? Thanks for the great vid!

  • @SachinKumar-25
    @SachinKumar-25 Před rokem

    Thank You.

  • @user-qj7pf8ws2g
    @user-qj7pf8ws2g Před 7 měsíci

    can we use this for refreshing the datatable LWC component from a different LWC component as onclick button ?

  • @RaviShankar1947
    @RaviShankar1947 Před rokem

    How it will refresh custom component if both standard and custom component is on different page/tab ?

  • @dandamudisiva
    @dandamudisiva Před 3 měsíci

    I just tried this one, update action only triggers refresh view api but not triggering when new record create happened. @salesforce troop do you have any idea.

    • @salesforcetroop
      @salesforcetroop  Před 3 měsíci

      approach is bit different if you are on service locker instead of Lightning Web Security.

  • @metasimulate3984
    @metasimulate3984 Před 6 měsíci

    ❤❤

  • @ianroque3308
    @ianroque3308 Před 8 měsíci

    Is this needed if i am using wire without apex?

  • @user-vs9lm7cu3d
    @user-vs9lm7cu3d Před rokem

    How i can use this if any changes is done in its related object and I have to again refresh the component.

    • @user-vs9lm7cu3d
      @user-vs9lm7cu3d Před rokem

      What modification is needed on this code to achieve this?

  • @isdamful
    @isdamful Před rokem

    What is the actual use of deregistering the handler

    • @salesforcetroop
      @salesforcetroop  Před rokem +2

      if we keep on listening the event even the component is not on screen it hit the performance so to keep the listening close when move away we use deregistering.

  • @user-qw5dc3rw3s
    @user-qw5dc3rw3s Před rokem

    👍