form2 send data to form1 with count script
Hi,
I can't find the correct script tu autonumber data filled in form1 with form2. Any help?
Thanks,
Mic
on success form2
- if (count(form1[Lugar == input.Lugar]) == 0)
- {
- input.Numero = 1;
- }
- else
- {
- highestMatchingRecord = form1 [Lugar == input.Lugar] sort by Numero desc range from 1 to 1;
- number = (highestMatchingRecord.Numero + 1);
- }
- if (count(form1[Numero == input.Numero.toLong()]) > 0)
- {
- rec = form1 [Numero == input.Numero.toLong()];
- if (input.Numero == null)
- {
- input.Numero = "";
- }
- rec.Status = "Option";
- rec.Numero = Number;
- rec.Nome = input.Nome;
- rec.Sobrenome = input.Sobrenome;
- rec.Lugar = "Option";
- rec.Dia = zoho.currentdate;
- }