Create a button that saves and closes the form

Hello,

I am trying to create a button that changes the value of the "Status" field to "Submit Request", save this change, and close the form sending the user back to the homepage. I have entered the following code in the OnClick property of the button and I am able to update the "Status" field, but for some reason it's not saving the change when the form closes.

{
fd.field('Status').value('Submit Request');
window.alert("Your request has been submitted successfully!");
fd.save();
window.open("http://arsshpiuatv/ProjectPortalListUAT/", '_self');
}
return fd.save();

See screenshot below:

I believe I was able to resolve this issue by adding a new "Save" button and then placing the code on its OnClick property:

{
fd.field('Status').value('Submit Request');
window.alert("Your request has been submitted successfully!");
}

1 Like