LWC Bootcamp Day 44 | Part 2: Lightning Data Table : Update Record with Inline Edit

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • Topmate Link for One-to-One Connect
    topmate.io/tec...
    Welcome to Part 2 of our Lightning Data Table tutorial series! In this episode, we dive deeper into Salesforce Lightning Data Tables, exploring two crucial functionalities: Updating Records and Loading Picklist Values Dynamically.
    ⚙️ Updating Records:
    Learn how to make your Lightning Data Table interactive by enabling record updates! We'll guide you through the process of configuring editable columns and handling record updates in the Lightning component controller.
    🔄 Loading Picklist Values Dynamically:
    Discover how to dynamically load picklist values in your Lightning Data Table. We'll leverage Apex controllers to fetch picklist values from Salesforce and seamlessly integrate them into your Lightning component.
    🔧 Key Topics Covered:
    Enabling record updates in Lightning Data Table.
    Configuring editable columns with the editable attribute.
    Handling record updates in the Lightning component controller.
    Dynamically loading picklist values using Apex controllers.
    Integrating picklist values into your Lightning component for a dynamic user experience.
    👩‍💻 Prerequisites:
    Make sure you have watched Part 1 of our Lightning Data Table series to build a solid foundation before diving into this advanced tutorial.
    🔔 Subscribe and Stay Tuned:
    Don't forget to subscribe to our channel for more Salesforce tutorials, tips, and best practices. Hit the notification bell to stay updated on the latest content!
    #salesforce #lwc #lightningwebcomponent #salesforcedeveloper #salesforcelighting

КОМЕНТАРІ • 17

  • @fitnessdune
    @fitnessdune 2 місяці тому

    Hi @Ankit Jain, Thanks for the Wonderful content, I have had one doubt.
    How to edit custom Types that we implemented in previous session ? I tried with name column but it's not working

    • @TechJourneyWithAnkit
      @TechJourneyWithAnkit  2 місяці тому

      I beleive If the component are in use it will not allow to do.

  • @nitinnainwal
    @nitinnainwal 4 місяці тому

    Hi Ankit, Save button functionality is not working for me. It is showing - Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received. Please help.

    • @nitinnainwal
      @nitinnainwal 4 місяці тому

      I have done the exactly same thing as you did in this video.

    • @Nitin-ep4xg
      @Nitin-ep4xg 4 місяці тому

      Hey can you post your code here. i believe you are getting error on the line--> let updateRecPromiseArray = updateRecordsArray.map((currItem) => updateRecord(currItem))
      // console.log('updateRecPromiseArray>>>' , JSON.stringify(updateRecPromiseArray));
      or you can check in debug console by applying breakpoints.

    • @rahulsingh-cs8og
      @rahulsingh-cs8og Місяць тому

      Hi, I was also recieving same issue but need to do some changes and now its working.
      async HandlerSave(event) {
      let records=event.detail.draftValues;//return of array of updated values of record
      let updaterecordArray = records.map((currItem) => {
      let fieldInput={...currItem};
      return{
      fields: fieldInput
      };
      });
      this.draftValues=[];
      let updaterecordPromise = updaterecordArray.map((currItem)=> updateRecord(currItem));
      try{
      await Promise.all(updaterecordPromise);
      const evt = new ShowToastEvent({
      title: "Success",
      message: "Record is Updated Successfully",
      variant: "success"
      });
      this.dispatchEvent(evt);
      }
      catch(error){
      console.log(error);
      }
      }

      }
      also if you are trying to update name than you will get error as in salesforce first name and last name you should use to update. but for other field it will work as in my case.

  • @amarmute7384
    @amarmute7384 2 місяці тому

    Hi...Ankit how we can update Rich-text area field can u please guide mi in that

    • @TechJourneyWithAnkit
      @TechJourneyWithAnkit  2 місяці тому

      Don't do that, it will be a bad user experience, use row action, open modal and put rich text there

    • @amarmute7384
      @amarmute7384 2 місяці тому

      @@TechJourneyWithAnkit Thanks Ankit for u r reply...but I had a requirement that I want to in-line edit rich text area field in list view...with standard datatable it's not possible it converts rich text into normal....whts could be my approach please guide mi into that

  • @kallurma
    @kallurma 6 місяців тому

    Hi @Anki, it's nice session. It's very useful for me. I need help I'm displaying all columns in lwc datatable popup. When i click on save it's not saving

    • @TechJourneyWithAnkit
      @TechJourneyWithAnkit  6 місяців тому

      Check the error message in catch block to validate why it is not saving

  • @SfdcLearner
    @SfdcLearner 7 місяців тому

    Got to this video by Search. I loved it. Now i will watch Whole series from Beginning ❤

  • @AmarGiram-j8g
    @AmarGiram-j8g 7 місяців тому

    Hello Ankit, its very helpful knowledge you are sharing thanks for that, I am also requesting to you make video on populating lookup field and inline editing.

  • @laggavenkatagiri8464
    @laggavenkatagiri8464 4 місяці тому

    Good Video !!