Hi all,
Can someone please tell me why my code would error out on CU 5402 UOM Mgmt, specifically at the Item.Testfield("No.) line under GetQtyPerUnitofMeasure function? Below is my code to import 6 columns of data: locationcode,item,variantcode,qty,UOM,BusinessEntity.
I already set up a Item Journal template called Item with batch name = AU007. I can't understand why it would error out. Please help.
I have included the data from my csv file here...
AU007 A045 001-00 1 EA AU
AU007 A045 1882-00 1 EA AU
AU007 A045 1887-00 -1 EA AU
AU007 A045 511-00 1 EA AU
The error is You must specify No. in ItemNo?
Integer - OnBeforeImportRecord()
LocationCode := '';
ItemNo := '';
VariantCode := '';
Qty := '';
UOM := '';
BusinessEntity := '';
Integer - OnAfterImportRecord()
LineNo += 10000;
WITH ItemJnlLine DO BEGIN
INIT;
"Journal Template Name" := 'ITEM';
"Journal Batch Name" := 'AU007';
"Line No." := LineNo;
"Reason Code" := 'COUNT';
INSERT(TRUE);
"Posting Date" := 020117D;
VALIDATE("Entry Type",ItemJnlLine."Entry Type"::"Positive Adjmt.");
"Document No." := 'AU_invcount';
IF EVALUATE("Location Code",LocationCode) THEN
VALIDATE("Location Code");
IF EVALUATE("Item No.",ItemNo) THEN
VALIDATE("Item No.");
IF EVALUATE("Variant Code",VariantCode) THEN
VALIDATE("Variant Code");
IF EVALUATE(Quantity,Qty) THEN
VALIDATE(Quantity);
IF EVALUATE("Unit of Measure Code",UOM) THEN
VALIDATE("Unit of Measure Code");
IF EVALUATE("Shortcut Dimension 2 Code",BusinessEntity) THEN
VALIDATE("Shortcut Dimension 2 Code");
MODIFY(TRUE);
END;
0
Answers