Hello,
Trying to validate the first character of the No. in the Employee table. No. is of type code. Now I want to make sure that only No. starting with A or B are accepted. I've being trying to use
Code:
copystr
to get the first character and thus if its not equal to A or B returns an error but it doesn't work.
Any ideas welcome please! Brick wall Brick wall Brick wall
_________________
Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
0
Answers
in the OnValidate of the Account No. field you should be able to do...
No one loves you like the one who created you...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
IF "Account No." is blank, it will raise an error.
Eto
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
if not ("Account No."[1] in ) then
Error(TextXXX);
This is currently working with first Characters with A or B. But after typing the first Character with A Or B, it allows other letters to follow.
What i want in addition to this is to let it accept only the Letters A or B as first letters then followed by four digit Numbers. It should not allow anyother letter apart from A or B and it should not be repeated. Only A and four digit nos or B and Four digit nos.
The Nos. too should not exceed four digits. What modification can one do on the above code?
Any idea on this.
this will test any given code (text) with given format string like 'A00000' or 'B00000' where 0 is for any number and other characters must be same. You can extend it and make possible to have A or B when format character is 'A' etc...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Different approch here same result as above!
i is a variable integer
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com