Hey,
In my table, I've set one colomn to unique.
I was wondering if I could show a custom code with 'DB save' if a same value is been used.
Now i'm getting:
And I would like to have something like:
In my table, I've set one colomn to unique.
I was wondering if I could show a custom code with 'DB save' if a same value is been used.
Now i'm getting:
Error: 0 - SQL=INSERT INTO `TB_data_family` (`cf_created`,`family`) VALUES ('2014-02-18 09:20:57','3test')
And I would like to have something like:
Sorry, This name is already been used. Try again with another name...
Hi brononius,
You could put a MySQL query into a Custom Serverside Validation action to check if the name is already in use.
Bob
You could put a MySQL query into a Custom Serverside Validation action to check if the name is already in use.
Bob
I have exactly the same challenge. The suggestion of checking if the value is already present before the save is not bulletproof. There is the (tiny) chance that the check would reveal no duplicate but that a new row is added (by some other process) in the moment of time between the check and the DB Save attempt. If the newly added row has the same indexed column value as the form that is about to be saved, then the form will fail to save.
It is a shame that one cannot check whether a DB Save has been successful and then programmatically examine the reason.
It is a shame that one cannot check whether a DB Save has been successful and then programmatically examine the reason.
This topic is locked and no more replies can be posted.