Can't modifiy item because have item ledger entries

catiamatos1991
Member Posts: 158
Hi everyone,
I've a xmlport to import/export my item list and some other info and I'm usng this to create / modify items between stores because is a very easy way of doing it instead of packages which takes more time.
So my xml port,

OnPostXMLport()
IF (Inserted > 0) OR (Modified > 0) THEN
MESSAGE(FinalMsg, Inserted, Modified);
BarCodes - Export::OnPreXMLItem()
ItemBarcode.RESET;
ItemBarcode.SETRANGE("Item No.", Item."No.");
IF ItemBarcode.FINDSET THEN
BarCodes.SETRANGE(Number, 1, ItemBarcode.COUNT)
ELSE
currXMLport.BREAK;
BarCodes - Export::OnAfterGetRecord()
IF BarCodes.Number = 1 THEN
ItemBarcode.FINDFIRST
ELSE
ItemBarcode.NEXT;
Barcode := ItemBarcode."Barcode No.";
BarCodes - Import::OnAfterInitRecord()
Barcode - Import::OnAfterAssignVariable()
ItemBarcode.RESET;
IF NOT ItemBarcode.GET(Barcode) THEN BEGIN
ItemBarcode.INIT;
ItemBarcode."Barcode No." := Barcode;
ItemBarcode."Item No." := Item."No.";
ItemBarcode.INSERT(TRUE);
END;
And when I import in some stores I get the error message that item x have already item ledger entries and my process of importing is terminated. I need to "force" the modificiation already because I need to change some descriptions and base unit of measure and the system is not allowing me with my xmlport.. I don't know what kind of validation or code I need to add can you help pls?
In my xmlport I've removed the "validation" part of fields.
I've a xmlport to import/export my item list and some other info and I'm usng this to create / modify items between stores because is a very easy way of doing it instead of packages which takes more time.
So my xml port,

OnPostXMLport()
IF (Inserted > 0) OR (Modified > 0) THEN
MESSAGE(FinalMsg, Inserted, Modified);
BarCodes - Export::OnPreXMLItem()
ItemBarcode.RESET;
ItemBarcode.SETRANGE("Item No.", Item."No.");
IF ItemBarcode.FINDSET THEN
BarCodes.SETRANGE(Number, 1, ItemBarcode.COUNT)
ELSE
currXMLport.BREAK;
BarCodes - Export::OnAfterGetRecord()
IF BarCodes.Number = 1 THEN
ItemBarcode.FINDFIRST
ELSE
ItemBarcode.NEXT;
Barcode := ItemBarcode."Barcode No.";
BarCodes - Import::OnAfterInitRecord()
Barcode - Import::OnAfterAssignVariable()
ItemBarcode.RESET;
IF NOT ItemBarcode.GET(Barcode) THEN BEGIN
ItemBarcode.INIT;
ItemBarcode."Barcode No." := Barcode;
ItemBarcode."Item No." := Item."No.";
ItemBarcode.INSERT(TRUE);
END;
And when I import in some stores I get the error message that item x have already item ledger entries and my process of importing is terminated. I need to "force" the modificiation already because I need to change some descriptions and base unit of measure and the system is not allowing me with my xmlport.. I don't know what kind of validation or code I need to add can you help pls?
In my xmlport I've removed the "validation" part of fields.
0
Answers
-
Hello,
Enable the Auto-update property on the XML port.
0 -
In my Item element node I have autosave and autoupdate = yes and autoplace = no0
-
Hello
You cant change "Base unit of measure" if the item has ledger entries. This is because all item transactions are based on "base unit of measure". Changing this would mess up with inventory value.
Description should be ok to change.0 -
Hi,
go to property of yourXML port and give permission "RMID" to table 27.
and then try to upload again.
hope this work.
0 -
sbs is right. No changing of Base UOM. What you can do is to import that into a variable and only fill it in the item if the Base UOM is currently empty. That should do the trick.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