Hello,
I need to find a way to stop my users from entering " and , into the item desription field. We have to periodically export to a .csv file and these values are causing problems. Any advise would be greatly appreciated.
if you use STRPOS to search the string for the characters you want and it returns a value of anything but zero then it exists.
another way is to determine the allowable characters
txtAllowedChars := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; // string with all allowed characters
vDescription := DELSTR(Description,'=',txtAllowedChars);
IF vDescription <> '' THEN ERROR('Characters "%1" are not allowed',vDescription);
Another solution is to not export it as csv, but as TAB delimited and the only value they cannot enter is TAB which is not possible to enter manually in NAV.
Ahmed Rashed Amini
Independent Consultant/Developer
another solution is to just add code to remove " when they enter it.
The following code onvalidate
Description := Delchr(Description,'=','"');
I use a variation of this method, it works fine, before I export data, I run a processing only report on the table, it removes the charactures. I'm an end user and can't add code to the form, but you can accomplish the same end result with a processing only report.
I also wanted our customer search name field to not contain any spaces or other special charactures, it should only be letters,
so John's Truck & Equipment Co. should have a search name of
JOHHSTRUCKEQUIPMENTCO
I use a processing only report, that runs from the job queue with the following info.
using the nested delchr, deletes everything that is not a letter.
Why not just set the CharAllowed property, no code, simple and does what you want.
Just
go to the Table designer,
go to the Description field
Open properties
Find the CharAllowed Property
In this property, enter the secret code #+ !-~
Why not just set the CharAllowed property, no code, simple and does what you want.
Just
go to the Table designer,
go to the Description field
Open properties
Find the CharAllowed Property
In this property, enter the secret code #+ !-~
Why not just set the CharAllowed property, no code, simple and does what you want.
Just
go to the Table designer,
go to the Description field
Open properties
Find the CharAllowed Property
In this property, enter the secret code #+ !-~
there are certain special characters which i need to delete ,that cannot be mentioned in coding like for example
(Item description = SWR Pipe Type B SL á 3.6Mtr(12ft)á 90mm) . how to make navision system understand this character ( which is bold). kindly guide... i had passed these special charaters in navision like
corrstr:=DELCHR(getsrt,'<>','àû');
but still the special characters is not getting deleted. wats is the fault ?
yes sir... you are right ... today morning when i came i found that the special character i have entered is wroang and rectified it... now it is working fine...... :thumbsup:
yes sir... you are right ... today morning when i came i found that the special character i have entered is wroang and rectified it... now it is working fine...... :thumbsup:
Comments
Look into STRPOS which will help you search for a specific character, and COPYSTR, which will let you take substrings. DELCHR might also help.
My Blog - nav.education
another way is to determine the allowable characters
txtAllowedChars := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; // string with all allowed characters
vDescription := DELSTR(Description,'=',txtAllowedChars);
IF vDescription <> '' THEN ERROR('Characters "%1" are not allowed',vDescription);
http://www.BiloBeauty.com
http://www.autismspeaks.org
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The following code onvalidate
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I also wanted our customer search name field to not contain any spaces or other special charactures, it should only be letters,
so John's Truck & Equipment Co. should have a search name of
JOHHSTRUCKEQUIPMENTCO
I use a processing only report, that runs from the job queue with the following info.
using the nested delchr, deletes everything that is not a letter.
"Search Name" := DELCHR(Name,'=',DELCHR(Name,'=','ABCDEFGHIJKLMNOPQRSTUVWXYZ'));
Modify;
Just
go to the Table designer,
go to the Description field
Open properties
Find the CharAllowed Property
In this property, enter the secret code #+ !-~
That should work for you.
(copy paste the code so you get it right.
I didn't even know that property existed.
This is one of those threads I love. Every post is a valid solution to the question.
My Blog - nav.education
The CharAllowed #+ !-~ worked!!
Thank you very much!! =D>
I am lazy, and a terrible typist, so I always look for the easiest solution. Glad it helped you out.
Genius!!!
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
:oops: Thanks
(Item description = SWR Pipe Type B SL á 3.6Mtr(12ft)á 90mm) . how to make navision system understand this character ( which is bold). kindly guide... i had passed these special charaters in navision like
corrstr:=DELCHR(getsrt,'<>','àû');
but still the special characters is not getting deleted. wats is the fault ?
it should be
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Actually I think also the á and à are an issue. :whistle:
you're welcome.
What is it mean?
Is it mean that it only allow any character: #+ <spaces> !-~ ?
Thank you.
That's such an out-of-the-box approach. Thinking simply, yet brilliant. Great! :thumbsup:
Andwian