Copy existing Item from Card to new Item Card

tompynation
Member Posts: 398
Hi,
would this be possible?
Suppose you are in the item card watching to Item No. 1,
You press a copy button which should automatically open a new Item Card
containing the Data of Item No. 1 but it should not contain the Item No.
Cause the Copy will be used to add new Items in a verry fast way, so you should just enter a new item No.
lv_Item.Category := rec.Cat;
I tried with form.Run("Item Card",lv_Item)
But the Form that opens does not contain the category, but it copied the Item No. ?
would this be possible?
Suppose you are in the item card watching to Item No. 1,
You press a copy button which should automatically open a new Item Card
containing the Data of Item No. 1 but it should not contain the Item No.
Cause the Copy will be used to add new Items in a verry fast way, so you should just enter a new item No.
lv_Item.Category := rec.Cat;
I tried with form.Run("Item Card",lv_Item)
But the Form that opens does not contain the category, but it copied the Item No. ?
0
Comments
-
Open the Item List form from the Item Card, highlight the Item that you want to copy, hit Ctrl+C. Close the Item List, which brings back the Item Card. Hit F3 to create a new empty record, hit Ctrl+V to paste the Item in. You'll get an error message saying "Item already exists" but the Item is pasted into the form. Change the Item number and voila, you have an exact copy of the Item.
All you need to do is take care of subsidiary records, such as Item Units of Measure. Your new Item will have the same units, but you will have to create the "Item Unit of Measure" records that belong there.0 -
The following code might help you. For the COPY function you want
Name DataType Subtype it Record Item it.INIT; it.RESET; it.COPY(Rec); it."No." := 'Test'; it.INSERT(TRUE); FORM.RUN(30,it);
but there r lot of validations you have to take care of. Possible care would be...
1) validating all fields before inserting.
2) special attention to Lookup fields for whether the master value exists or not in the corresponding master table. [ Base Unit Of Measure has a intermediate table -- "Item Unit of Measure" and lookup master table - "Unit of Measure". Values in the "Item Unit of Measure" must be inserted before inserting into Item table,... this should be handled in the code while copying.]
More Inputs are welcome from the Experts. O:)Sandeep Prajapati
Technical Consultant, MS Dynamics NAV0 -
if you asked for the new Item No. at first and do the insert&TransferFields after that, it would be a lot easier0
-
Daniels way is the method I've always used.
Go to item card. Edit->Select->Copy->F3->Paste->"Ignore Message"->Change the item number to something new.0 -
I had forgotten the 'edit-select' part from the Item Card, thanks Harry =D>0
-
The German localization has a feature to copy items. Might be interesting to have a look at the code of it.
Item Copy
Companies often maintain groups of similar items in an item catalog, and many settings are typically the same. When you add a new
item, you can use Item Copy by copying information from an existing item into a new one.
To copy an item, click Item Copy from the Functions button of that item card. Item Copy is also available in the item list. Choose
which data to copy in the request form:
Base data
Item comments
Picture
UOMs
Variants
Dimensions
Extended texts
Translations
BOM components
Prices
Service -related information
Item Copy supports number series and manual numbers for the new item number.0 -
Too Bad - I Just don't have a German Version Laying around0
-
if you need it, i will post it here.Do you make it right, it works too!0
-
What about the standard templates? Depends upon the version, I presume from the Functions button on the item card you do not have "Apply template"? In this method you would create a new record, then copy everything else in, which is slightly different to your original request, but gets you your end result!The art of teaching is clarity and the art of learning is to listen0
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