Lightning Web Components:@Wire and Imperative Apex Server Calls in LWC

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

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

  • @chithraprakash8392
    @chithraprakash8392 Год назад +1

    Thank you for making this very informative video. Please make more videos on LWC

  • @shreyaraut9270
    @shreyaraut9270 3 года назад +7

    Just one day before I saw your video and next day the interviewer asked me to write the same program and I got the job 😀 Thanks you for the knowledge you shared 😊 👍

    • @sunilmithra7012
      @sunilmithra7012 3 года назад

      Hi, Can you share the details of the program query you have been asked in the interview?

    • @shreyaraut9270
      @shreyaraut9270 3 года назад +1

      write LWC to fetch account and related contacts.

    • @sunilmithra7012
      @sunilmithra7012 3 года назад

      @@shreyaraut9270 thank you

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  3 года назад +1

      @shreya raut
      Thank you. I am glad it helped you. Congratulations for your job and all the best.

    • @kallurma
      @kallurma 3 года назад

      Thank you for sharing the knowledge
      I have query how to get parent values when click on new child button(overridden) along with I need to add check box and radio group, input field how can I achieve this scenario

  • @vineetsrivastava388
    @vineetsrivastava388 4 года назад +1

    Very neatly explained. Will look out for the series on LWC from ur side.

  • @vijayank923
    @vijayank923 2 года назад +2

    thank u... i am very clear about your explanation....

  • @malleshsalesforce1894
    @malleshsalesforce1894 Год назад

    Thank you, great efforts .

  • @wamcy100
    @wamcy100 Год назад

    I don't get what you are doing with the parameter Boolean in apex class method.

  • @arjunwalia737
    @arjunwalia737 9 месяцев назад

    can you tell me what's the reason to write Aura or calling the LWC component in the Aura for writing Wire?

  • @shashis9131
    @shashis9131 4 года назад +1

    Super simple explanation

  • @chinq6t
    @chinq6t 4 года назад +1

    @19:54: What is the purpose of passing the Apex parameter, 'Boolean flag' into the Apex method, 'contactListCtrl.getContactList'? As I understand in your example, the showContact JS variable gets evaluated, then {flag: '$showContact'} gets passed into the @wire decorator and calls the getContactList Apex method. Is it just an example of showing how to pass a parameter to the Apex method that your example does not use?

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  4 года назад +2

      @Tom $showContact is a reactive an dynamic property here. So if we are using dynamic property in @wire apex class, whenever value of this property changes($showContact in our case), @wire call is executed. We have not used it in apex method as I just wanted to show how dynamic properties work. Let me give you example, lets say we have account searching application based on user input of account name value, so in that case we can bind this input value to dynamic property so we do not have to use imperative call and @wire will be executed whenever user changes value on UI .

  • @kishoretalari5984
    @kishoretalari5984 4 года назад +1

    What is the main difference in wire and imperative. when we will go for the wire service ?

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  4 года назад +2

      @wire in general is used to fetch the data on load of components or if some parameters passed to apex method changes, so to bring fresh data.
      Imperative call can be used to fetch data, perform DML operations etc on some events say click of button.
      You cannot perform DML with @wire call.

    • @abhishekdalvi9564
      @abhishekdalvi9564 4 года назад +1

      @@SALESFORCEPREDATOR This is exactly what I was looking for.
      Thank you.

  • @AlbertsWorld42
    @AlbertsWorld42 Год назад

    Thanks a lot🙏

  • @lordshiva4615
    @lordshiva4615 3 года назад

    How to get the text out of a formula field and pass that text as an argument in the Apex class.(query used is field INCLUDES stringvalue). If you post a video like this. That will be helpful.

  • @RajeshJhunjhunuwala
    @RajeshJhunjhunuwala 4 года назад +1

    Excellent dear. Today it clear. Please upload about lwc event as well, will be highly appreciated

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  4 года назад +2

      Thank you :)@Rajesh. I have already added videos on events. ruclips.net/video/Zews9NIg0N8/видео.html
      You can watch other videos on playlist for communication between lwc components.

  • @FACTS-do8zy
    @FACTS-do8zy 3 года назад +1

    While using @wire, on server method we need to use cacheable = true and it is mandatory.
    While using imperative method, it is not mandatory

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  3 года назад

      That is correct. If we want cache to be there then we can mark server side method as cacheable while using imperative approach also.
      But in that case the result returned by method would be immutable and we cannot modify it directly, also we cannot perform any DML operations ,similar to in case of working with @wire

  • @ankitgupta0312
    @ankitgupta0312 3 года назад

    Nice bro

  • @teja7703
    @teja7703 4 года назад

    Can we use both imparative and wire method in same js file??

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  4 года назад

      @teja Yes, definitely there is no such restrictions.

    • @teja7703
      @teja7703 4 года назад

      @@SALESFORCEPREDATOR tq

  • @chaitanyabollamreddi1284
    @chaitanyabollamreddi1284 2 года назад

    Event is deprecated

  • @amitr9941
    @amitr9941 3 года назад +1

    You are just copying and pasting the code.. You are not at all explaining what is happening in each line of your code specially in JS part.

    • @SALESFORCEPREDATOR
      @SALESFORCEPREDATOR  3 года назад +4

      Hi @Amit, I tried explaining each line and also explained in presentation.May be I missed some point.Let me know which part you couldn't understand, will definitely help you.
      Also, I will take this suggestion and improve from next time so it would be easier for you.