0
submitDetails: function (component, event, helper) {   
    var selectCmp = event.getSource();
    console.log("selectCmp", selectCmp);
    var questions = component.find("questionEditForm");
    console.log("questions", questions);

    if (Array.isArray(questions) == true) {
      questions.forEach((form) => {
        console.log("form" + form);
        form.submit();
      });
    } else {
      questions.submit();
    }

    component.find("editForm").submit();
    component.set("v.isQuestionChange", false);
    
    console.log("check save");
  
  }

How can I modify the field value of each edit form before form.submit(); I have trouble when I modify things in the process builder then my aura page load before the process builder finish, the information don't up to date.

2
  • Do you have recordEditForm in an iteration? Commented Dec 21, 2021 at 5:02
  • hi @SachinHooda. Yeah, I am using it in an interation.
    – Le Hiep
    Commented Dec 22, 2021 at 8:38

1 Answer 1

0

try it like this :-

onSubmitHandler(event) {
event.preventDefault();
// Get data from submitted form
const fields = event.detail.fields;
// Here you can execute any logic before submit
// and set or modify existing fields
fields.Name = fields.Name + fields.Phone
// You need to submit the form after modifications
this.template
    .querySelector('lightning-record-edit-form').submit(fields);

}

You must log in to answer this question.

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