I have a project I want to do because it's been bugging me forever.
When we switched to Nav a long while ago we imported our data like everyone else. All of our cust names, address, city etc. have lots of blank spaces at the end so when you put them together you get
NEW YORK__________, NY instead of
NEW YORK, NY for example.
I would like to create a report to wipe out these trailing Blanks but I am having trouble. I've read about "Hard Blanks" in previous posts so I went the Char route.
OnPreDataItem()
MyChar := 255;
MyText := FORMAT(MyChar);
OnAfterGetRecord()
FOR i := 1 TO STRLEN(Vendor.City) DO
BEGIN
IF (Vendor.City <> ' ') THEN
NewCity :=DELCHR(Vendor.City,'>',MyText);
END;
Vendor.MODIFY;
Can you help me point to where I'm going wrong?
Should I be Deleting Characters or Rebuilding the String?
0
Answers
So New York will become NewYork.
Until there is double blank, delete that string.
Freelance Dynamics AX
Blog : http://axnmaia.wordpress.com/
am I not using this correctly?
http://www.BiloBeauty.com
http://www.autismspeaks.org
Vendor.City := NewCity;
before the MODIFY statement.
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
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
"googling" didn't give me any result
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
It is a handy way to insert some 'blanks' to be seen but they don't behave like blanks.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Anyway ...
I once had a job where I had to import purch. invoices from an AS/400. For one reason or another, all imported fields ended with blanks at the end (filling the field). I used ara3n's code for this, and everything worked just fine ... so I guess no hard blanks there... .
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
This is the greatest code in the history of Navision!!!!
(for me)
HA HA!! \:D/ \:D/ \:D/
http://www.BiloBeauty.com
http://www.autismspeaks.org
I used Newcity - cause I didn't want to change the actual city until I knew it worked.
http://www.BiloBeauty.com
http://www.autismspeaks.org
RIS Plus, LLC