Can't modifiy item because have item ledger entries

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,

yfca89pkhlea.png


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.

Answers

  • Tech_girlTech_girl Posts: 1Member
    Hello,

    Enable the Auto-update property on the XML port.

    pj1myeygj487.png
  • catiamatos1991catiamatos1991 Posts: 158Member
    In my Item element node I have autosave and autoupdate = yes and autoplace = no
  • sbssbs Posts: 26Member
    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.
  • tomarsuniltomarsunil indiaPosts: 22Member
    Hi,
    go to property of yourXML port and give permission "RMID" to table 27.
    and then try to upload again.
    hope this work.
    qm8kbfts5z4d.png

  • Miklos_HollenderMiklos_Hollender Posts: 1,589Member
    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.
Sign In or Register to comment.