Error on a simple inventory count import

MisConsultng
Member Posts: 17
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;
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
Best Answer
-
I think mostly the error is occurred due to non-availability of UOM in Item Unit of Measure table. The validate function used for "Item No." in OnBeforeImportRecord() trigger would trigger the onvalidate code which is redirected to 5402 CU.
5
Answers
-
I think mostly the error is occurred due to non-availability of UOM in Item Unit of Measure table. The validate function used for "Item No." in OnBeforeImportRecord() trigger would trigger the onvalidate code which is redirected to 5402 CU.
5 -
Thanks for pointing this out. I believe you are right on about this error. I found out shortly after that many of our items, due to some issues with the dataport (most likely the lack of validation) that the Base UOM looks fine on the surface/item card, but when you drill down to get to the Item UOM table the Code field is blank!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