LWC for creating record(for custom object), and have utilized the record-edit-form to display some fields on that object, collect the information, and submit it to create a new record.
My question is: would it be possible to have a second lightning-button in my form, also using the type="submit" tag, and then be able
to determine in the JavaScript which of the two were clicked? I'm looking to have a "Save" button and then a "save & New" button
which would save record and refresh the form with keeping lookupfield value after refresh.
I tried using a separate button with an explicit onClick call to another method, but then I found that i lose visibility to the fields that are populated in the form like it is not considering any of validation , record will be saved for all null values etc
Your suggestions will be much appreciated and welcomed....
Thank you
2 个回答
Don't use the reocrd id property
Save will be a save action and close
Sane and New will be a save action and reset fields