function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tomasddtomasdd 

Add custom button in lightning record form

is there a chance to add custom button in lightning record form? For example we're creating a record and we have two buttons "Cancel" and "Save". When I click "Save" I have a view layout with all data regarding created record and here under the data I would like to add button something like "Create New Record".
 
Is it possible to add it using JS+HTML or is it completly impossible to gain ?
ShirishaShirisha (Salesforce Developers) 
Hi Tomas,

Greetings!

You cannot inject any buttons on lightning:recordForm directly. But you can always create custom buttons on the component that utilizes this component. You will though need a mechanism to interact with the fields on the record form.

If you want custom behavior, you should instead look to use lightning:recordEditForm

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

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
tomasddtomasdd
Hi Shirisha,

I'm not using an aura component. I would like to add this button in lightning web component.

Could You provide an example how may I achieve this? How to add this button?