Alert if a record already exist

Alert if a record already exist

Hi Zoho community

I would like to create an alert message if a record already exists in a report. 
can someone please give me a hint on what should I write or where should I read?

I am trying this: 

if (Objecion[Factura == input.Factura].count()  >  0)
{
    alert "Este número de factura ya existe, Favor verificar estado.";
}

with no success
am I in the right path?



any help will be appreciated