Hello together..
I just did something what you may want to use too.
We have a field (ansprechpartner) . It holds the name of the contact-person.
It was pretty anoying for me when the call agents wrote some sh*t in this field.
Like "???" or "***" or other stuff like this..
So i made this:
i wanted to check if a field (in this example "ansprechpartner") haves only allowed characters.. you can do this with the format control:
1st step:
Modify the formatcontrol in the calculation-tab like this:
Add= true
Upd=true
Calculation:
$error=true;$ok="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZäÄÖöüÜß-.";$ln=lng(ansprechpartner in $file);for $c = 1 to $ln do ($temp=substr(ansprechpartner in $file, $c, 1);if (index($temp, $ok)=0) then ($noerror=false))
2nd step:
Modify the formatcontrol in the validation-tab like this:
add=true
upd=true
validation: $noerror
message: Your message what you want to bring up when a wrong character was found in the current field.
The variable $ok holds all characters which are allowed to use. You can change that as you want it to have.
the variable $ln is the lengh of the field ansprechpartner.
the variable $noerror mußt be true. If it is false.. it brings your message in the status line.
All this together checks if the field hold only characters like
abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZäÄÖöüÜß-.
If you want to build a emailaddress with this field... (thats case in my system) you should check if they
fill out the first AND the lastname completly.. instead of "Hr. Eisenhauer" they should write "Frank Eisenhauer"
So i changed the query from step 1 like this:
$noerror=true;$ok="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZäÄÖöüÜß-.";$ln=lng(ansprechpartner in $file);for $c = 1 to $ln do ($temp=substr(ansprechpartner in $file, $c, 1);if (index($temp, $ok)=0) then ($noerror=false));
if (index(" ", ansprechpartner in $file)=0) then ($noerror=false);if (substr(ansprechpartner in $file, 1, 2)="Hr" or substr(ansprechpartner in $file, 1, 2)="HR" or substr(ansprechpartner in $file, 1, 3)="Fr." or substr(ansprechpartner in $file, 1, 3)="FR." or
index(" ", ansprechpartner in $file)=0 or substr(ansprechpartner in $file, 1, 4)="Herr" or substr(ansprechpartner in $file, 1, 5)="Frau ") then ($noerror=false)
This query looks for allowed characters AND also for short forms like Hr. Herr, Fr. Frau.
That works pretty fine..
Maybe some of you guys can and want to use it.
If there are any questions about that...
Write me back.
Bye from Germany.
Frank


Reply With Quote
Bookmarks