# Blank Item No.

**URL:** <https://www.dynamicsuser.net/t/blank-item-no/517>\
**Category:** Developers Forum\
**Created:** [August 24, 2006, 9:19pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517 "2006-08-24T21:19:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 24, 2006, 9:19pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517/1 "2006-08-24T21:19:03Z")

</div>

Version 3.70 (3.70.A) Native

Got an Item Record with a no. Want to rename it to, but get the error

_"You cannot rename a record because the old value of the field below is ‘’,_

_Field: No._

_Table: Item"_

Thing is the item in question has history, don’t really want to delete it.

Any suggestions?

BTW - The Item was blank when I got there.

T

---

<div class="post-metadata">

**Author:** ![claushamann](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@claushamann](https://www.dynamicsuser.net/u/claushamann)\
**Post date:** [August 24, 2006, 11:10pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517/2 "2006-08-24T23:10:29Z")

</div>

Hi Tony

How did you manage to get an item with blank Item No.? This should not be possible.

However I have seen this a few times before, usually because a user have created a dataport that imports / updates items. An item with blank No. is created when the last line in the file is empty.

The history you see for the blank item is probably not related to the blank item. The Item No. on entries is being blanked out if you deleted an item so the entries you see with blank Item No. is probably related to deleted items.

Regards

Claus

P.S.

I forgot to say, I would just delete the item from code and without executing the OnDelete trigger code.

---

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 24, 2006, 11:20pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517/3 "2006-08-24T23:20:37Z")

</div>

> [@](#):
>
> BTW - The Item was blank when I got there.

I’ve checked out the posted document descriptions, they are the right item!

Not sure who managed to do it, but they did!

---

<div class="post-metadata">

**Author:** ![phenomenon](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@phenomenon](https://www.dynamicsuser.net/u/phenomenon)\
**Post date:** [August 24, 2006, 11:40pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517/4 "2006-08-24T23:40:45Z")

</div>

And nobody noticed that while executing transactions over that item?  
…

You can (probably) override navision’s “check code” that is checking wheter there are posted documents with that item or not. Everything would probably be ok after that except you’ll have a new item (at least, no Item No.) in a reports. Is there a lot of entries in ledger for it or it’s kind of minor priority item?

---

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 25, 2006, 12:26am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/5 "2006-08-25T00:26:26Z")

</div>

_And nobody noticed that while executing transactions over that item?_

LOL! Obviously not!

The items dead, but they want to rename it, so its not showing as a blank item, and they want to maintain the history.

Basically I want to know if there is anyway to bypass this rename “message”

If not I’ll just code a solution.

---

<div class="post-metadata">

**Author:** ![phenomenon](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@phenomenon](https://www.dynamicsuser.net/u/phenomenon)\
**Post date:** [August 25, 2006, 12:42am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/6 "2006-08-25T00:42:40Z")

</div>

I’m not sure you need a “code solution”. At least on SQL server, if you simply rename Item No. it will rename all appropriate table entries (SQL 3.60, though…)

All you need is to bypass check code. If you have downtime (f.e. when nobody is logged on navision) do it in that time:

Comment out check code in Item table (OnModify trigger) and simply rename that Item No.

We did this on several occasions (only on one same clients database and on their explicit request) and it all went well but, do testing, ofcourse…

---

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 25, 2006, 12:50am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/7 "2006-08-25T00:50:16Z")

</div>

> [@](#):
>
> Version 3.70 (3.70.A) Native

See above

This is not a piece of code on the Rename trigger, so I can’t comment it out!

---

<div class="post-metadata">

**Author:** ![phenomenon](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@phenomenon](https://www.dynamicsuser.net/u/phenomenon)\
**Post date:** [August 25, 2006, 12:57am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/8 "2006-08-25T00:57:57Z")

</div>

Outch, sorry. [:$]

I missed the problem, I was thinking more about a problem of renaming item that has ledger entries.

Once, I had a same problem with unability to change from empty to non-empty No. and easy solution for me was to delete/create again that entry but in your case that is not applicable…

phuuuhh, sorry on sidetracking…

---

<div class="post-metadata">

**Author:** ![colingbradley](https://avatars.discourse-cdn.com/v4/letter/c/bc8723/32.png) [@colingbradley](https://www.dynamicsuser.net/u/colingbradley)\
**Post date:** [August 25, 2006, 2:42am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/9 "2006-08-25T02:42:43Z")

</div>

You do need to be careful here, you will have lines in orders that have Type::Item but a blank “No.” simply because nobody selected the item with the empty “No.”.

The first thing I would do is to write a report to go through each table where the “No.” = ‘’ and after checking order lines and posted document lines, delete the unwanted lines and rename each of the legitimate entries.

You may have to rem out the checks in some of the tables.

I have a client who has a blank “No.” also, but they use it as a generic entry.

Yeah, I know.

---

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 25, 2006, 3:42am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/10 "2006-08-25T03:42:43Z")

</div>

I’m just trying to find out if I can bypass this message, thats all!

If I can’t I’m pretty happy writing a rouinte to “fix” the data.

Not sure I would be happy deleteing “Unwanted Lines” in posted documents though!

---

<div class="post-metadata">

**Author:** ![claushamann](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@claushamann](https://www.dynamicsuser.net/u/claushamann)\
**Post date:** [August 25, 2006, 4:26am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/11 "2006-08-25T04:26:41Z")

</div>

Hi Tony

To my knowledge you can not bypass the error. Navision will not let you rename a blank primary key if the blank primary key has been used in “related tables”. In you case you can not rename the blank item as item ledger entries exist with blank item no. I guess Navision have made this blocking as Item No is being blanked in Item Ledger Entries when the Item is deleted (same goes for e.g. Customer and Vendor).

Regards

Claus

---

<div class="post-metadata">

**Author:** ![themave](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@themave](https://www.dynamicsuser.net/u/themave)\
**Post date:** [August 25, 2006, 9:35am UTC](https://www.dynamicsuser.net/t/blank-item-no/517/12 "2006-08-25T09:35:31Z")

</div>

> [@](#):
>
> Hi Tony
> 
> To my knowledge you can not bypass the error. Navision will not let you rename a blank primary key if the blank primary key has been used in “related tables”. In you case you can not rename the blank item as item ledger entries exist with blank item no. I guess Navision have made this blocking as Item No is being blanked in Item Ledger Entries when the Item is deleted (same goes for e.g. Customer and Vendor).
> 
> Regards
> 
> Claus

Well then, why not change the primary key, rename the record and then change the primary key back

---

<div class="post-metadata">

**Author:** ![TonyH](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@TonyH](https://www.dynamicsuser.net/u/TonyH)\
**Post date:** [August 25, 2006, 6:00pm UTC](https://www.dynamicsuser.net/t/blank-item-no/517/13 "2006-08-25T18:00:00Z")

</div>

> [@](#):
>
> Hi Tony
> 
> To my knowledge you can not bypass the error. Navision will not let you rename a blank primary key if the blank primary key has been used in “related tables”. In you case you can not rename the blank item as item ledger entries exist with blank item no. I guess Navision have made this blocking as Item No is being blanked in Item Ledger Entries when the Item is deleted (same goes for e.g. Customer and Vendor).
> 
> Regards
> 
> Claus

Guess I’ll have to do it the old fahioned way then. [:D]
