One item ledger entry for each item

KisuKisu Member Posts: 381
Heys I'd need a code unit that adds each item one item ledger entry
so I could fetch Warehouse -> Inventory -> Phys. Inventory Journal list full with the items.

The inventory needs atleast one ledger entry to show up on the phys. inventory journal list. Non of my items has an entry so I would need to populate them, all this will be done on demo database.

Code unit I have done so far is:

nimikkeet.RESET;
nimikkeet.SETCURRENTKEY("No.");
nimikkeet.SETRANGE("No.",'=>0');

IF nimikkeet.FIND('-') THEN
REPEAT
nimikeledger."Entry No." := ???
nimikeledger."Item No." := nimikkeet."No.";
nimikeledger."Qty. per Unit of Measure" := 1;
nimikeledger."Unit of Measure Code" := nimikkeet."Sales Unit of Measure";
nimikeledger.MODIFY(FALSE);
UNTIL nimikkeet.NEXT = 0;

it wont work yet cause I'm not sure how to add the "Entry No." for the ledger table...

Any help would be appreciated. :shock:
K.S.

Comments

  • KisuKisu Member Posts: 381
    nimikkeet = record var for the item table
    and
    nimikeledger = record var for the phys item ledger table
    K.S.
  • ajhvdbajhvdb Member Posts: 672
    Please don't start using this code in a "live" db. Search the forum for examples. I hate to see you loosing your job.
  • jonsan21jonsan21 Member Posts: 118
    Use CRONUS database - you can demo using that...

    Rgds,

    Jon.
    Rgds,

    Jon.
  • KisuKisu Member Posts: 381
    Yes and it wont be live. I would just need the inventory journal out to test something and since not every item has entries they cant be fetch with the inventory journal function.

    one item ledger entry line needs, quantity, measure, unique number and the item name.
    K.S.
  • KisuKisu Member Posts: 381
    Ah solved it :)
    K.S.
  • KowaKowa Member Posts: 923
    Of course you should normally never manually create ledger entries, but for the roll-out of a new system, this is the one exception to that rule. I would recommend to use negative entry nos to make it clear that these are dummy entries and don't forget to change the entry no. for the last dummy entry to 0 to ensure that the normal posting of item ledger entry will start with ledger Entry No. 1. Then you can delete the dummy records with zero quantities after going live without having trouble with inconsistancies in the item journals. This can turn out to be important in an audit if that is checked.
    Kai Kowalewski
Sign In or Register to comment.