How to restrict the end user to enter the duplicate emails or mobile?

Certified Associate Developer

Hi all,

I am working on a project, I want to restrict the end user to enter the duplicate email ids or mobile numbers. I mean, end user cannot enter the email or mobile number if it's already exist in the Database.

It should show an error message if user entered existed email id on the interface.

Solutions would be highly appreciated.

Thank you in advance!

  Discussion posts and replies are publicly visible

Parents
  • Do you want to see if this user has already entered the same phone number / email or any user? If it's only for this user, it's probably easiest to query on loading the form to return all of this user's existing emails / phone numbers. Then, you could do a comparison in a validation to check if the user has already entered this value or not.

    If you're looking to see if this phone number / email is unique across all of your data, you should likely query after the user has entered the data to check and see if there are any rows in the database with that exact email / phone number.

  • 0
    Certified Lead Developer
    in reply to Peter Lewis

    Additionally, in the latter case, a designer should consider the corner case where person A enters an Email or phone number that *actually* belongs to person B, and then (later) person B tries to enter it - should the system now not let them enter it, because a previous user fat-fingered and/or stole theirs?  As someone with a "first.last" gmail address, this issue is deeply personal to me...

Reply
  • 0
    Certified Lead Developer
    in reply to Peter Lewis

    Additionally, in the latter case, a designer should consider the corner case where person A enters an Email or phone number that *actually* belongs to person B, and then (later) person B tries to enter it - should the system now not let them enter it, because a previous user fat-fingered and/or stole theirs?  As someone with a "first.last" gmail address, this issue is deeply personal to me...

Children
No Data