Not allow specific value in item decription field

cwiginton
Member Posts: 16
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.
Thanks
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.
Thanks
0
Comments
-
So essentially you need to parse your text before saving it to the database.
Look into STRPOS which will help you search for a specific character, and COPYSTR, which will let you take substrings. DELCHR might also help.0 -
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);0 -
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.0
-
another solution is to just add code to remove " when they enter it.
The following code onvalidateDescription := Delchr(Description,'=','"');
0 -
ara3n wrote:another solution is to just add code to remove " when they enter it.
The following code onvalidateDescription := Delchr(Description,'=','"');
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;0 -
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 #+ !-~#+ !-~
That should work for you.
(copy paste the code so you get it right.David Singleton0 -
David Singleton wrote:Why not just set the CharAllowed property, no code, simple and does what you want.
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.0 -
David,
The CharAllowed #+ !-~ worked!!
Thank you very much!! =D>0 -
cwiginton wrote:David,
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.
David Singleton0 -
David Singleton wrote: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 #+ !-~#+ !-~
That should work for you.
(copy paste the code so you get it right.
Genius!!!Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
Alex Chow wrote:David Singleton wrote: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 #+ !-~#+ !-~
That should work for you.
(copy paste the code so you get it right.
Genius!!!
:oops: ThanksDavid Singleton0 -
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 ?0 -
You wrote
corrstr:=DELCHR(getsrt,'<>','àû');
it should becorrstr:=DELCHR(getsrt,'=','àû');
0 -
southindian wrote:SWR Pipe Type B SL á 3.6Mtr(12ft)á 90mm) .southindian wrote:corrstr:=DELCHR(getsrt,'<>','àû');
Actually I think also the á and à are an issue. :whistle:David Singleton0 -
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:0
-
southindian wrote: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:
you're welcome.David Singleton0 -
David Singleton wrote:enter the secret code #+ !-~
#+ !-~
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:Regards,
Andwian0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions