How to update a record and canceling the submit of the form?
Hello,
I am trying to update a record with the data introduced in a form, but I dont want to create a new entry in te report, only update the entry that exists.
I tried checking if the entry exists with On Validate, but if I use "cancel submit", the entry does not update. Although if I delete "cancel submit", the entry updates but a new entry with the form data appears, and that is the thing I dont want.
Is there a way to do this? This is my simple code
- if (Equipo_Comercial[SalespersonID != input.SalespersonID].count() > 0)
- {
- actualizar = Equipo_Comercial[SalespersonID == input.SalespersonID];
- actualizar.Nombre = "Test";
- alert "Actualizado";
- cancel submit;
- }