Trim required strings before post
Posted: Tue 04 May 2010 11:06
Hi,
Using D2010.
I'm running against both SQL Server and PostgreSQL DBs.
Is there a point in code where I can trim leading and trailing spaces from required (not null) fields to prevent users entering one or more spaces rather than valid characters (e.g. A..B, 0..9)
I know I can code for this in field validate events or dataset before post events but I would find the option to always trim required (not null) fields be very useful.
I have one table in particular that accepts a 4 character, user defined code where they can enter a "meaningful" code along with other details. It now has records with codes 'A', ' A', ' A' and various other combinations. They all work but aren't very friendly - I don't know what makes them do stuff like this or how they use them...
Thanks in advance.
Regards, Paul.
Using D2010.
I'm running against both SQL Server and PostgreSQL DBs.
Is there a point in code where I can trim leading and trailing spaces from required (not null) fields to prevent users entering one or more spaces rather than valid characters (e.g. A..B, 0..9)
I know I can code for this in field validate events or dataset before post events but I would find the option to always trim required (not null) fields be very useful.
I have one table in particular that accepts a 4 character, user defined code where they can enter a "meaningful" code along with other details. It now has records with codes 'A', ' A', ' A' and various other combinations. They all work but aren't very friendly - I don't know what makes them do stuff like this or how they use them...
Thanks in advance.
Regards, Paul.