Check for Duplicated Item No

vios15
Member Posts: 43
Dear Expert,
I have created a dataport that allow import of data from csv into a temporary table, it's working fine, but I would the system to check after import for duplication of ordered item No. As the duplication of item could create problem in the later stage. I would like to solve it at the temporary table first.
Does anyone has a solution?
Thanks
I have created a dataport that allow import of data from csv into a temporary table, it's working fine, but I would the system to check after import for duplication of ordered item No. As the duplication of item could create problem in the later stage. I would like to solve it at the temporary table first.
Does anyone has a solution?
Thanks
0
Answers
-
Something like:
recTemporaryTable.RESET; recTemporaryTable.SETCURRENTKEY("Item No."); IF recTemporaryTable.FINDSET THEN REPEAT recTemporaryTable2.RESET; recTemporaryTable2.RESET; recTemporaryTable2.SETCURRENTKEY("Item No.","Customer No."); recTemporaryTable2.SETRANGE("Item No.",recTemporaryTable."Item No."); recTemporaryTable2.SETRANGE("Customer No.",recTemporaryTable."Customer No."); IF recTemporaryTable2.COUNT > 1 THEN BEGIN MESSAGE('Item %1 is ordered more than once',recTemporaryTable."Item No."); END; UNTIL recTemporaryTable.NEXT = 0;
What does it do?
It loops all records in the table and checks how many records exist of the combination "Item No."+"Customer No.".
If each customer can order each item only once, the COUNT should be 1. If it is more than 1, it means the customer ordered the item more than once.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi kriki,
Thanks for the reply.
I will test it out and revert.
Thanks0 -
Hi kriki,
I have tried your solution and it is working.
Thanks for the help.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