0

I need to clone an item that contains lightning:recordEditForm before the user clicks submit and values are saved. The problem is that before my cloning I need to force recordEditForm to save. I looked through google but can't find answer:

Is there way to wait for cmp.find('editForm').submit() to execute? Or is there any way to wait till event fire() executes?

If I just try to run it normally cmp.find('editForm').submit() executes too slow and I don't have proper values in cloned item. I tested it with setTimeout and it's working but would prefer some other mechanism.

Can I somehow use promise or callback for an event or submit()?

1 Answer 1

0

You can attach an onsuccess handler to continue.

<lightning:recordEditForm onsubmit="{!c.handleSubmit}" onsuccess="{!c.handleSuccess}" ... />

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .