Lightning Record Edit Form in LWC | Create Record | Part 15

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 พ.ย. 2023
  • Hello developers,
    Learn how to use Lightning record edit form in lwc and create records without writing any apex class.
    Key points to note :
    1) when to use lightning record edit form.
    2) How to use lightning record edit form.
    Create form with multiple fields without record edit form : • Build a Simple form wi...

ความคิดเห็น • 8

  • @kiranreddy6155
    @kiranreddy6155 หลายเดือนก่อน +1

    This video is missing from the playlist. Can you add this to playlist?

  • @moonsunpuducherry
    @moonsunpuducherry 6 หลายเดือนก่อน +1

    Hi, how to prepopulate field values while create records in LWC.

    • @salesforcein5minutes
      @salesforcein5minutes  6 หลายเดือนก่อน +1

      While create records you can prepopulate using handleload or even wire so when component us reloading you can create variables for example :
      Js file :
      Var mydata
      @wire(data) {
      mydata = data.name:
      }
      In html file :
      But this will lead you to create variables for each of value one morr way is ( consider same js as above)
      So now u can directly assign thr value of data without creating multiple variables hope this helps and if no plz let me know

    • @moonsunpuducherry
      @moonsunpuducherry 6 หลายเดือนก่อน

      @@salesforcein5minutes thank you so much for your quick reply. The following is my interview question. How to prepopulate default fields values in contacts create view page. eg: phone= 1234567890, LastName=xyz. So when user clicks on the contact create new page, those two fields values should be populated by default.

  • @venkataswamykadiyam977
    @venkataswamykadiyam977 2 หลายเดือนก่อน +1

    Hi ,
    I am trying to create a Case record using lightning record edit form , in this creation there are 2 lookup fields ContactId & AssetId. The ContactId is populating all the contacts, but the AssetId needs to populate the values which are related to specefic selected contactId. The AssetId is only showing the asset values which are not associated with any Contacts.
    Could you please help me this.
    Thanks!!!

    • @salesforcein5minutes
      @salesforcein5minutes  2 หลายเดือนก่อน +1

      In this case create a wrapper which will have atleast 1 variables of type map, in which key will be contact id and value will be list of assetids
      Now basically do the following :
      List< asset> assetlist = select id, contactid from asset where contactid = whatever its
      For (Asset assets : assetlist) {
      Wrapper. Mapvar. Put(assets.contactid, list{ assetid}) ;
      }
      Throw this wrapper to yout js file and now parse this so it will be convertrd to object
      Now loop in js on this map where key will be contact id and value will list of asset id use map to get asset id related to contact id.

    • @venkataswamykadiyam977
      @venkataswamykadiyam977 2 หลายเดือนก่อน

      @@salesforcein5minutes But I want those asset values to get populate in the AssetId field which is lookup in the case creation form, can we pls connect once if there is any possibility?