Hi all,
Feels like my question should be a common one, but I can't seem to find any answers..
On the "Create Contact" form we would like to prevent duplicate creations based on a certain criteria (say BirthDate, Lastname & Firstname).
The form's OnSave event runs a Javascript method that uses the REST endpoint to query the database for the matching criteria. If any are found, we would like to prevent the save using geteventargs().preventdefault().
We call preventdefault() from the anonymous function in the 'On Complete' parameter of RetrieveMultiple(), however does not stop the save.
I think the problem is that the REST endpoint is asynchronous and what we need is a synchronous call. We've tried looping w/Timeouts and whatnot but we're obviously doing something wrong.
Is there any way to do this without converting our code to a Plugin?
Thanks.