Delete double BinCode from BinContent
rossale
Member Posts: 26
Hi!!
I've to delete some BinCode(s) from BinContent Table, only for those Item No. repeated twice in the same Location.
Have some one some ideas? How can I do?
Example:
Location | Bin Code | Item No.
1 | AAA.AAA | 0.65789A
1 | BBB.BBB| 0.65789A
1 | CCC.CCC | 1.5698A
1 | DDD.DDD | 54564Q
1 | BBB.BBB | 1.2345
1 | EEE.EEE | A.12345
1 | BBB.BBB | A.12345
I've to delete the Item No. 0.65789A with the Bin Code
BBB.BBB and the Item No. A.12345 with the Bin Code
BBB.BBB
Thanks
Alex
I've to delete some BinCode(s) from BinContent Table, only for those Item No. repeated twice in the same Location.
Have some one some ideas? How can I do?
Example:
Location | Bin Code | Item No.
1 | AAA.AAA | 0.65789A
1 | BBB.BBB| 0.65789A
1 | CCC.CCC | 1.5698A
1 | DDD.DDD | 54564Q
1 | BBB.BBB | 1.2345
1 | EEE.EEE | A.12345
1 | BBB.BBB | A.12345
I've to delete the Item No. 0.65789A with the Bin Code
BBB.BBB and the Item No. A.12345 with the Bin Code
BBB.BBB
Thanks
Alex
0
Answers
-
-
Hi Ing. Sacek !!
I've to delete the duplicated Items 'cause I don't need two different Bin Code for the same Item.
Originally the Item was in a fixed Bin Code (BBB.BBB), when we added the new Bin Code we have forgotten to delete the fixed one. So now I've to delete the wrong Bin Code.
Thanks
Alex0 -
How do you know which Bin code is the correct one for the particular item?
e.g. when I have item X on bin A and B and item Y on bin A and B, for item X is correct A or B? How can the system know that? :?:0 -
The correct one is the Bin Code not fixed...
e.g.
1 | AAA.AAA | 0.65789A <---- CORRECT
1 | BBB.BBB| 0.65789A <---- TO DELETE
The Bin Code named "BBB.BBB" is a "fixed code" that we use for those articles that we don't want to manage in warehouse but only for anagrafics purpouse. So we have many Items associated to the "BBB.BBB" Bin Code, when we want to store in warehouse an article we create a new Bin Code and we delete it from the "fixed position" (if exist).
Now, since we didn't delete the "fixed" before create the new one, we have some articles coded twice. These articles have to delete.
Also a report could help me, but I don't know how to filter all the Items coded twice.
Thanks
Alex0 -
you need something like:
Go through all FIXED bin records in Bin Content for each if exists record with same location and item but other BIN then delete the fixed bin record
it meansBinContent.SETRANGE("Bin Code",'BBB.BBB'); if BinContent.FINDSET then repeat BinContent2.RESET; BinContent2.SETRANGE(Location,BinContent.Location); BinContent2.SETRANGE("Item No.",BinContent."Item No."); BinContent2.SETFILTER("Bin Code",'<>%1','BBB.BBB'); if not BinContent2.IsEmpty then begin //other bin found BinContent2 := BinContent; BinContent2.DELETE; // delete the fixed bin through another var than used for iteration end; until BinContent.NEXT=0;
Code is not tested, is written from scratch. Do not forget to add usage of correct Keys etc...0 -
Thanks Ing. Sacek !!
I'm going to try in report first ....
But I'm sure that is the right SOLUTION !!
Thanks
Alex
p.s. I try then I mark as SOLVED the Topic...........0 -
Hi Ing. Sacek,
I try... but actually it doesn't works... Could you help me?
Is there a simply way to sort the "Item No."? In this way I could find the duplicated....
Thanks a lot for your help.
Alex0 -
SOLVED.
I made in another way manually by using filtering.
Thanks
Alex0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
