Accidently Deleted Items with Ledger entries

whighsmith
Member Posts: 11
Guys I just made a mistake.
I deleted a bunch of old items thinking Navision wouldn't let me delete any item with ledger entries. Now I realise I was wrong. I deleted about 266 items that had ledger entries.
Because I often report off the ledger entry & value entry tables, I would really like to restore this data.
I have all info in a backup database.
Is it possible to restore all information from these items as if I had not deleted them?
Thanks so much for the help!
I deleted a bunch of old items thinking Navision wouldn't let me delete any item with ledger entries. Now I realise I was wrong. I deleted about 266 items that had ledger entries.
Because I often report off the ledger entry & value entry tables, I would really like to restore this data.
I have all info in a backup database.
Is it possible to restore all information from these items as if I had not deleted them?
Thanks so much for the help!
0
Comments
-
My dear friend,
Now you can do only one thing that insert the ledger enters manually with the same no. very carefully. If you follow any other process that may have some other impacts.Mukesh Sharma0 -
hello. When you delete an item that has entries in closed accounting period, Navision does not delete the value and item ledger entries. It simply blanks the Item no.
So what you need to do is restore the back in a separate database. copy and past the items that you want to restore. Then write a routine to fill the item not in value entry and item ledger entry.
You can still run your reports on the ledger. it just that the item will be blank.0 -
ara3n wrote:hello. When you delete an item that has entries in closed accounting period, Navision does not delete the value and item ledger entries. It simply blanks the Item no.
So what you need to do is restore the back in a separate database. copy and past the items that you want to restore. Then write a routine to fill the item not in value entry and item ledger entry.
You can still run your reports on the ledger. it just that the item will be blank.
Basically, if you run your reports based on item will not match the reports based on customers if the item ledger has blank item numbers on the item ledger.
It's okay so long as the customers understand the consequences.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
If I try that I get a message about "legder entries existing" unless they are years old and everything is closed.0
-
In which way was the items deleted? Through some custom code? Or by pressing Delete or F4? (I want to know if the OnDelete trigger was called or not, if not, you just needs to re-create the item records and not the ledger entries).0
-
Use the information on the Item Ledger and Value entries to recreate your items, this sample code is a guide and not complete or tested.
Create a simple report on the item ledger entry, Group this by "Item No.", give this report any table permissions required.
Create a function in the report called CheckItem with a local variables, Item type Record, Value Entry type record, and any other tables like Item unit of Measure etc:, and on the group header or footer call the function after the standard code.IF CurrReport.SHOWOUTPUT THEN CheckItem();
CheckItem() IF NOT Item.GET("Item Ledger Entry"."Item No.")THEN BEGIN Item.INIT; Item."No." := "Item Ledger Entry"."Item No."; Item.Description := "Item Ledger Entry".Description; ValueEntry.RESET; ValueEntry.SETCURRENTKEY("Item Ledger Entry No."); ValueEntry.SETRANGE("Item Ledger Entry No.","Item Ledger Entry","Entry No."); IF ValueEntry.FINDFIRST THEN Item."Inventory Posting Group" := ValueEntry."Inventory Posting Group"; //Add new code to Insert UOM table //Add new code to Insert Dimensions from Ledger Entry Dimension Table Item.INSERT; END;
Add code to insert the units of measure from the values in the Item Ledger, or value entry, also from the item ledger you may be able to get the dimensions, and other static information.Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
If you have an old backup, you could also restore this as a stand alone, you know the criteria for the Items you deleted, create some dataports and Export the records, then Import them back into your live database this will recreate any lost records, but you would loose any changes.
Items as required
All Default Dimensions for Table 27 Item
Tables you would need to export all records for.
Item Unit Of Measure
And if required
Item Bill of Materials
Purchase and Sales PricesAnalyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
kine wrote:In which way was the items deleted? Through some custom code? Or by pressing Delete or F4? (I want to know if the OnDelete trigger was called or not, if not, you just needs to re-create the item records and not the ledger entries).
Yes I deleted using F4.
Thanks for all the help everyone!0
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