Skip to main content
I have created a custom lightning component that is using lightning:recordEditForm. The same component I am calling from Salesforce new, edit and clone buttons.

I am confused about how to make the same custom lightning component behave differently for three behaviours - the new, edit and clone?
2 respostas
  1. 15 de mai. de 2021, 07:31
    Hi Raghav,

    recordEditForm is a standard component provided by the salesforce.

    You can use it to save a new record or update i.e edit the existing record.

    To edit the existing record you will have to provide the id of the record to the recordEditForm.

    For example,

    <lightning:recordEditForm objectApiName="Object" recordId="{!v.recordId}">

    and will have to add the field inside the form you need to edit.

    but I don't think that currently, there is any functionality to clone a record using lightning:recordEditForm 

    You can refer the link for the proper documentation on the lightning:recordEditForm.

    https://developer.salesforce.com/docs/component-library/bundle/lightning:recordEditForm/documentation

    If this helped you please mark it as the best answer

    Thanks and Regards 

    Suraj Tripathi
0/9000