is there a chance to add custom button into ? For example we're creating a record and we have to 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 ?


The only component in the lightning forms you can do this through is the lightning-record-edit-form as this does not build out the form internal components for you like lightning-record-form where the internal elements are very limited to access due to the shadow dom which blocks external manipulation from other javascript. I would suggest that if you want to use custom buttons in the layout to use the lightning-record-edit-form for this case. if your use case also calls for a view mode, you can swap to a lightning-record-view-form as well by triggering a render attribute custom in your JS file to handle render switches from form events. lightning-record-view-form similarly will allow you to construct the internal form layout custom but is read only as it is a view form.

lightning-record-edit-form allows for use of lightning-input-field and lightning-output-field support while lightning-record-view-form supports lightning-output-field` and other lightning-input types, but does not offer functionality that will allow for modification of the record contained in the form.

| improve this answer | |
  • Hi Ronnie, thanks for replay. Could You show me how may I do this I mean how to add this button only in "success" Window? – Freeezer789 Apr 9 at 22:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.