Hello,
for one of our customers, a blank Item (with all fields, including "No." empty) keeps appearing every few months.
I need to catch how it happens. It 99% happens from code, because NotBlank = Yes doesn't help.
Any ideas how to find the place?
0
Comments
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
I think maybe closer to 100%.
Anyway be very careful with Blank Items. These can be very dangerous. The Search and Replace mechanism in Navision can not handle blanks. (This is by design). When you delete an Item, or compress ledgers, all its history is moved to a "Blank" item, so if you tried to delete or rename that Item from a form, you will have problems. Also it can cause problems renaming other records that are linked to item, even if no linked to the blank one.
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/
This will error for any user input, or any code that does an INSERT(TRUE) into this table.
Unfortunately it wont pick up any code that just does an INSERT.
You could also put this code into the OnModify and OnRename triggers as well.
Hopefully this will highlight what process is causing the problem.
I have found out that the codeunit Inventory Adjustment (5895), creates a blank Item No, if for some reason there is posting.
InsertDeletedItem(VAR Item : Record Item)
CLEAR(Item);
Item.INIT;
// --> [1]
Item.Description := 'Codeunit 5895';
// <-- [1]
Item."Cost is Adjusted" := FALSE;
Item."Costing Method" := Item."Costing Method"::FIFO;
Item.INSERT;
I don't know if this is the case, but this is the only code which creates a blank Item No.
Kenneth Jarlshøi Bolø
Dynateam A/S
When you have an Blank Item No, it is definitivly inserted by autom. inserts.
Check our modif. Code. Or use DevTool to find the parts where an Item is inserted. Mostly an Dataport or XMLPort is the reason.