i have one temp table , with the following columns :
Document No. Line No Item No. Barcode Description Quantity cost amount
i want to create one item journal with the same data here , imean to transfer lines to item journal with batch template name ( item) and batch journal name ( transfer ) .
my code is the following , but still i can't see the data thier
IF NOT posted THEN BEGIN
ItemJnlLine.RESET;
ItemJnlLine.SETRANGE("Journal Template Name",'item');
ItemJnlLine.SETRANGE("Journal Batch Name",'WASTAGE');
IF ItemJnlLine.FIND('-') THEN
ItemJnlLine."Line No." := (ItemJnlLine.COUNT + 1) * 10000
ELSE
ItemJnlLine."Line No." := 10000;
tempwlines.RESET;
tempwlines.SETRANGE("Document No.",ItemJnlLine."Document No.");
tempwlines.SETRANGE("Line No",ItemJnlLine."Line No.");
IF tempwlines.FIND('-') THEN REPEAT
ItemJnlLine.INIT;
ItemJnlLine."Journal Template Name" :='item';
ItemJnlLine."Journal Batch Name" :='wastage';
ItemJnlLine."Document No." := "Document No.";
ItemJnlLine."Line No." := tempwlines."Line No";
ItemJnlLine.VALIDATE("Document No.","Document No.");
ItemJnlLine.VALIDATE("Line No.",tempwlines."Line No");
ItemJnlLine.INSERT;
LineNo += 10000;
UNTIL tempwlines.NEXT =0;
MESSAGE('Wastage created in item journal');
posted:=TRUE;
MODIFY;
END;
any one can help , where's the problem
0
Comments
Have you look at the Item Journal Line table to see if it there?
Andwian
Do you see the records from the object designer?
Did you try copy & Paste? Click the blank box on the top left of the grid to select all - then copy & paste.
I have a dataport to import Items & Qty's into the item journal. The key is to execute the code in the same order as you would be entering it manually.
Yours isn't a dataport but here what mine looks like..it should simlar
If you're is a report or something you can throw in a
If Not Insert Then modify;
http://www.BiloBeauty.com
http://www.autismspeaks.org