How to Update Primary Key Item Code in Item Card
selece28
Member Posts: 316
Hi All,
I'm having problems. My client want to update their Item Code in Item Card.
I know i can do Rename from Item Card and Nav wil automatically update the other related table. But If i get a csv file and want to update by script, Is is possible to do?
How is the best way to do it?
I'm thinking of copy All records to one temp table, deleteall records in Item table, then insert again from temp table to Item table with new item code.
But if i do this then nav won't automatically update the related table?
Help me please,
Thanks in advance
I'm having problems. My client want to update their Item Code in Item Card.
I know i can do Rename from Item Card and Nav wil automatically update the other related table. But If i get a csv file and want to update by script, Is is possible to do?
How is the best way to do it?
I'm thinking of copy All records to one temp table, deleteall records in Item table, then insert again from temp table to Item table with new item code.
But if i do this then nav won't automatically update the related table?
Help me please,
Thanks in advance
______________
Regards,
Steven
Regards,
Steven
0
Comments
-
You need to use RENAME function to change the PK of the record.
And yes, if you will do the DELETE/INSERT the relations will not be updated!0 -
Also I would write the dataport like this.
If item.get(Column[1]) then begin
item.rename(Column2);
commit;
end;
this will be a long process at least if you cancel you don't have to role back.0 -
Just want to make sure. Is the Rename function can update all related fields? Like sales price, Item UOM, etc?
Thanks in advance______________
Regards,
Steven0 -
-
Opps, i think cannot do this way.
I try using 10 items, i took so long.
How about if i delete table Item, Item UOM, Sales Price, and Item Ledger Entry.
Then i import(INSERT) the item again using dataport. Can i do this way?
When inserting the Item, i also insert the Item UOM.
Then import the item ledger entry and sales price.
Because my client want to have a clean DB for the year.
Is there any other table beside Item UOM, Sales Price and Item ledger entry that have relation to Item Table?
Thanks in advance______________
Regards,
Steven0 -
Many tables has this relation... all sales and purchase documents, value entries, transfers, service module, manufacturing... NAV is working with Items everywhere - it is why it took so long time...0
-
Wow so many tables.
I'm thinking of creating a new DB for them, so i just import the new Item Card, and the Sales Price table. Also Import opening Inventory balance.
I think this is the safest way.
Any comments or suggestion?
Thanks in advance______________
Regards,
Steven0
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
- 322 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

