How to rename an Item which consists a hidden character (ENTER)

elnowako
Member Posts: 12
Hi There,
NAV2013R2.
I have a few Items in my database where there are hidden characters stored in their codes.
When I am opening the Item Card i am getting an error message like this:
The record that you tried to open is not available. The page will close or show the next record.
Do you know how to rename such an Item? Or is there any way to get rid of this (ENTER) empty character from the Code?
Thank You in advance.
NAV2013R2.
I have a few Items in my database where there are hidden characters stored in their codes.
When I am opening the Item Card i am getting an error message like this:
The record that you tried to open is not available. The page will close or show the next record.
Do you know how to rename such an Item? Or is there any way to get rid of this (ENTER) empty character from the Code?
Thank You in advance.
0
Answers
-
Hello,
I believe the item was created outside NAV (by SQL directly) because in RTC you can't have hidden characters
So, I just tried what you described (i.e. create an item with TAB in its code) ==> I can open its card + I renamed it without any problem.
Maybe the issue is that your Item No is lowercase?0 -
Hi,
Thanks for the answer.
These Items have been created in NAV 5.0 by copy paste from Excel.
And I think I made a mistake, this is hidden character is not a TAB it is more like ENTER.
Then i made a conversion from 5.0 -> 2009 -> 2013 -> 2013R2.
It is not possible to recreate such an Item in the RTC client, and probably because of that it is also not possible to rename/delete.0 -
If you copied it from Excel then it is likely a new line at the end of it (two characters 0x0d 0x0a). The issue with pasing data from Excel was present in NAV until late NAV2009R2 platform update.
Try to create another item with the same code, and rename it instead. If it does not work you may be forced to rename Item in SQL - but it will be tricky
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-031 -
<DELETED>Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Have you tried something like:
CRLF[1] := 13; CRLF[2] := 10; CLEAR(Item); Item.SETFILTER("No.", '*' + CRLF + '*'); IF Item.FINDSET THEN REPEAT Item2.GET(Item."No."); Item2.RENAME(DELCHR(Item2."No.", '=', CRLF)); UNTIL Item.NEXT = 0;
Where:
0 -
It is not possible to Item.GET an Item if there is an ENTER inside of its code.
This Code:Item2.GET(Item."No.");
will always give an error.
It seems like it is possible only via SQL.0 -
Try:
... REPEAT Item2 := Item; Item2.RENAME(DELCHR(Item2."No.", '=', CRLF)); UNTIL Item.NEXT = 0
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
or this:
CRLF[1] := 13; CRLF[2] := 10; CLEAR(Item); Item.SETFILTER("No.", '*' + CRLF + '*'); WHILE Item.FINDFIRST THEN Item.RENAME(DELCHR(Item."No.", '=', CRLF));
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
@Slawek_Guzek I'm afraid FINDFIRST will stuck also
(according to @elnowako )
I would try RecRef.GETTABLE as it is not a read operation ?CLEAR(Item); Item.SETFILTER("No.", '*' + CRLF + '*'); IF Item.FINDSET THEN REPEAT CLEAR(RecRef); RecRef.GETTABLE(Item); RecRef.RENAME(DELCHR(Item."No.", '=', CRLF)); RecRef.CLOSE; UNTIL Item.NEXT = 0;
@elnowako When you say:will always give an error.
You tried it or you're guessing?
P.S: just trying to help
0 -
The problem here is probably the assignment, stripping the non-printable characters. as the value is assignet to CODE type field, and the internal validations kicks in. Just like in case typing in a CODE field a value startting or ending with a space.
It is easty to check with the following:CRLF[1] := 13; CRLF[2] := 10; CLEAR(Item); Item.SETFILTER("No.", '*' + CRLF + '*'); IF Item.FINDSET THEN BEGIN Item2."No." := Item."No."; MESSAGE('Item 1: >>%1<<, Item 2: >>%<<', Item."No.", Item2."No."); END;
If not this then it must be the GET stripping the white characters along the way
The code with FINDFIRST avoids both.
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-031 -
Hi There,
NAV2013R2.
I have a few Items in my database where there are hidden characters stored in their codes.
When I am opening the Item Card i am getting an error message like this:
The record that you tried to open is not available. The page will close or show the next record.
Do you know how to rename such an Item? Or is there any way to get rid of this (ENTER) empty character from the Code?
Thank You in advance.
I have seen this problem before, and fixing it in Navision is quite complex and slow. It is pretty simple (though tedious) to fix directly in SQL and a few orders of magnitude faster if you have a lot of items.David Singleton1
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