Remove Trailing space in 2013 R2


I have been upgraded from 2009 R2 to 2013 R2 and after the upgrade I have noticed that when opening some vendors system throws one message “The record that you tried to open is not available. The page will close or show the next record”

I have found that in in 2009 R2 for some vendors having trailing spaces and in 2013 R2 trailing space is not acceptable.

How can I remove these training spaces in Card and also in ledger entry ?

What about parsing the vendors and all the related tables with a code like this?

NewVendorNo := DELCHR("Vendor No.",'=',DELCHR("Vendor No.",'=',CharsToKeep));

Of course on Vendor table a rename statement will be required, on most of the related entities a modify will have to be performed.


Thanks for reply. My vendor numbers are like V-0633.

I will try what you have suggested.


Asharaf P

Asharaf, if you’re only interested in clearing trailing spaces, then you could also try …

VendorNo := DELCHR(Vendor.“No.”, ‘>’’);

Note that the DELCHR function call may take 3 arguments, and the 3rd argument typically identifies the characters that you want to delete from the string. If you leave that argument blank, and only pass 2 arguments to the function, NAV assumes that you want to delete spaces.

Sorry, there’s a typo in that command example, ignore the last apostrophe

Wrong: VendorNo := DELCHR(Vendor.“No.”, ‘>’’);

Right: VendorNo := DELCHR(Vendor.“No.”, ‘>’);