Decoding Lightning Record Edit Form in LWC | Lightning Data Service in LWC | LWC Tutorial

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • Hello Trailblazers, In this video we're going to learn how we can use Lightning Record Edit form in Lightning web components. We're also going to learn about the different attributes of lightning record edit form along with their purpose and the events which are fired at different instances while interacting with lightning record edit form. We'll also see how we can handle errors and setup default field values just before the form is submitted.
    Code:- github.com/rah...
    Subscribe to SFDC Stop:- www.youtube.co...
    LWC Todo App Project Tutorial Series - • Simplifying the Callou...
    Interested in learning about Scratch Orgs and SFDX ? Have a look at the playlist:- • Getting started with S...
    Interested in learning about Integration ? Have a look at this playlist:- • Salesforce Integration...

КОМЕНТАРІ • 33

  • @surajshitole9603
    @surajshitole9603 3 місяці тому

    Hi Rahul,
    Can we have picklist fields in lightning record edit form, or the dependent picklists ?

  • @pranavchavan9361
    @pranavchavan9361 Рік тому

    Hi Rahul,
    Thanks for making this video.....Its very helpful for all of us...
    Please make the video on winter 22 release to display related Objects
    records in lightning record forms using uiRelatedListApi
    ex.
    Parent Object: Opportunity
    Child Object : Opportunity Line Item, Orders

  • @naveenvelamakursalesforce7344
    @naveenvelamakursalesforce7344 2 роки тому +1

    How can I assign a value to field automatically it has to populate on that field value in lightning input field

    • @sfdcstop
      @sfdcstop  Рік тому

      You can get a reference to the field in onload event and set a value

  • @naveenvelamakursalesforce7344
    @naveenvelamakursalesforce7344 2 роки тому +1

    Is it possible to assign a default value to a field before submitting the form based on that field i need to do validation on other fields

    • @sfdcstop
      @sfdcstop  Рік тому

      Hi Naveen, yes it's possible by using the onsubmit event

  • @mahigenny687
    @mahigenny687 2 роки тому

    Thanks Rahul. your videos are detailed and to the point. I have couple of questions based on this video.
    1. on submit when you have overridden the data - mobile phone number is not prepopulated even though it has been persisted. If that has to be displayed do we have to set the details explicitly again.
    2. I was trying to see a record-form where upon saving it is blank and I can start adding a new record rather than default behavior. Basically I always want to keep the form empty as soon as I hit save and the form is ready for new account data to be entered...

    • @sfdcstop
      @sfdcstop  2 роки тому

      Hi Mahi, thank you for your feedback! Regarding the two queries:
      1. You need to update the record id in the record edit form once the save is successful and it'll refresh itself (usually we redirect the user to some other screen/page in this case or reset the form to show it as empty as getting some pre-filled values after saving when the user hasn't entered those may confuse the user)
      2. The default behaviour of lightning-record form is that it'll set the record id of the newly created record onto the form and switch to a read mode from the edit mode once the record is saved, you can try clearing the record id on success and check if that works. Although using record edit form is a better option for this use case if you're sure what fields you need to display.

    • @dhritisikdar127
      @dhritisikdar127 2 роки тому

      @@sfdcstop hi brother I have a small requirement to build a screen to add/update order record and order line and contacts as well and upload them as csv file, can you please help me with approach

  • @bhavyasree7227
    @bhavyasree7227 Рік тому

    Hi Rahul!
    Thanks for sharing us the video.
    I have a question. Can we add a label to the ?
    For example we pass the api name to the field name. How can I see it displayed as a “Email address” on the form?
    Thanks in advance.

  • @amitbagade3277
    @amitbagade3277 2 роки тому

    how to show two diffrent objects fields on one lightning form lwc and on saving data goes to respective object ?

    • @sfdcstop
      @sfdcstop  2 роки тому

      Hi Amit, if you're standard record edit form then you may need to use two such forms and submit both of them one by one, otherwise, you can create a custom lwc component.

  • @lukeshk7221
    @lukeshk7221 3 роки тому +1

    hello sir, u used there to display the messages at that position ?? I search for lightning-message component reference but unable to find any document Thank You.

    • @sfdcstop
      @sfdcstop  3 роки тому

      Hi Lukesh, that component is specific to lightning record edit form, view form and record form. It can be used inside them only, you can find it in the documentation page here:- developer.salesforce.com/docs/component-library/bundle/lightning-record-edit-form/documentation

  • @satyaprasad-qt1hh
    @satyaprasad-qt1hh Рік тому

    Hi if we use two lightning record edit from in single lightning web component, how we can handle save function

    • @sfdcstop
      @sfdcstop  Рік тому +1

      Hi Satya, do you want to have a single save button for both? If yes, you can get references to lightning-record-edit form using the querySelector() and submit both the forms one by one.

  • @mparvati8029
    @mparvati8029 3 роки тому +1

    sir can you make a video end to end on salesforceDX its really helpfully to me and others and LWC also.

    • @sfdcstop
      @sfdcstop  3 роки тому

      Hi Parvati, Thank you for the suggestion. To get started with LWC you can refer to the LWC Tutorial Series with Todo App Project: ua-cam.com/play/PLuL63vr-9xHyaEARj8crQe3v2TBQa_Cs8.html
      You'll have a project to showcase at the end of this playlist and it's from scratch. For SalesforceDX you can refer to this playlist: ua-cam.com/play/PLuL63vr-9xHwW96U64tORGA0HT5j1m0Ff.html
      It covers all important sfdx commands. Hope that helps!

    • @mparvati8029
      @mparvati8029 3 роки тому +1

      @@sfdcstop Thank you so much sir, for providing link and thanks for supporting the people as well. and please dont remove the videos.

    • @sfdcstop
      @sfdcstop  3 роки тому

      Videos will be here as it is always 😊 no need to worry about that 👍 Keep Learning..!!

  • @ravipatidar6265
    @ravipatidar6265 3 роки тому

    Awesome video 👍😁

    • @sfdcstop
      @sfdcstop  3 роки тому +1

      Thank you Buddy 😁

  • @pavandkbose
    @pavandkbose 2 роки тому

    Hi Sir, i have small ques
    1. there are event.target.value and event.detail.message and EVENT has many properties like so on which criteria we should use which one? im getting confused in selecting the Event.property type

    • @sfdcstop
      @sfdcstop  2 роки тому +1

      Hi Pavan, event.target.value is basically used to get the value of the input field. event.detail.message is mainly used when custom events are fired because in that case the value which is passed in the event is present in the detail attribute.

    • @pavandkbose
      @pavandkbose 2 роки тому

      @@sfdcstop Okay got it.. thanks brother.. now I understood.

  • @hemayejju3308
    @hemayejju3308 3 роки тому

    Sir how to make this more flexible like we need to give an text box for entering customer id & based On that customer id the details need to be fetched and it should be editable

    • @hemayejju3308
      @hemayejju3308 3 роки тому

      Sir actually this is an requirement for me...can you please explain how to acheive this feature

    • @sfdcstop
      @sfdcstop  3 роки тому +1

      Hi Hema, you need to create a custom UI for this and call the apex method once the customer ID is added by the user. The apex method can query return the whole record that you can display in the component

  • @rahulpalav9125
    @rahulpalav9125 2 роки тому

    Suppose I have to call another record form after submitting this form in onsuccess event how can we do that ?

    • @sfdcstop
      @sfdcstop  2 роки тому +1

      You can call resetForm() again once the submission is successful!

  • @pranavwagh6154
    @pranavwagh6154 2 роки тому

    After refreshing records..records not remains...any solution??

    • @sfdcstop
      @sfdcstop  2 роки тому

      Hi Pranav, can you explain in a bit detail?

    • @pranavwagh6154
      @pranavwagh6154 2 роки тому

      @@sfdcstop I have created custom fields in custom object and that fields are saved also but when i press the refresh button fill records not remains..requirement is that records view like account details..