Prevent Duplicate entries

A collection of tutorials and posts that show additional functionality of MATE

Moderator: KarelB

Prevent Duplicate entries

Postby scottdia » Tue Nov 22, 2016 7:01 pm

Id like to prevent duplicate value for a particular field when adding a record. I figured out how to do this through other suggestions, using val_fun and creating a function to check mysql. However, when I try to edit that record, it prevents any changes because it checks the same field and sees it as a duplicate. Can you prevent val_fun on the edit screen?
scottdia
 
Posts: 7
Joined: Wed Sep 07, 2016 8:01 pm

Re: Prevent Duplicate entries

Postby admin » Fri Jan 27, 2017 3:29 pm

You can check the $this->Editor->action variable to detect if the user is adding a row or editing a row.
admin
Site Admin
 
Posts: 1502
Joined: Fri Jul 11, 2008 1:34 am


Return to How To

Who is online

Users browsing this forum: No registered users and 2 guests

cron