So I have this function which would validate a field and checks if the internal reference number(custom field) is already used. Everything works fine but the only issue is with the alert. If the search has values the alert keeps on coming. I am unable to figure out why is it like that.