Dataport is created successfully but a slight problem occurs

Vesna
Member Posts: 24
Hello colleagues,
I created a dataport in PuchaseLine (39) for importing Vendor invoices.
Inserted Purchase Header lines and created the following Purchase Lines lines:
"Document Type":=PurchaseHeaderRec."Document Type"::Invoice;
"Document No." := NO;
"Line No." := 10000 ;
Type := Type::Item;
"No." := 'XXXX';
Description := 'XXXXXXXX' ;
"Unit of Measure Code" := 'PCS' ;
IF Qty <> 0 THEN
BEGIN
Quantity:=Qty;
END;
"Direct Unit Cost":= UnitCost;
"Line Amount":= Qty*UnitCost;
All required data are imported successfully. I open Invoice card and see quantity, direct unit cost and calculated Line Amount. However, when I click Test Post--Preview, I don't see quantity there as well as Amount is 0. The only data I see there is Direct Unit Cost (actual amount).
Could you tell me where is the error occurs?
Thank you very much
I created a dataport in PuchaseLine (39) for importing Vendor invoices.
Inserted Purchase Header lines and created the following Purchase Lines lines:
"Document Type":=PurchaseHeaderRec."Document Type"::Invoice;
"Document No." := NO;
"Line No." := 10000 ;
Type := Type::Item;
"No." := 'XXXX';
Description := 'XXXXXXXX' ;
"Unit of Measure Code" := 'PCS' ;
IF Qty <> 0 THEN
BEGIN
Quantity:=Qty;
END;
"Direct Unit Cost":= UnitCost;
"Line Amount":= Qty*UnitCost;
All required data are imported successfully. I open Invoice card and see quantity, direct unit cost and calculated Line Amount. However, when I click Test Post--Preview, I don't see quantity there as well as Amount is 0. The only data I see there is Direct Unit Cost (actual amount).
Could you tell me where is the error occurs?
Thank you very much
0
Comments
-
personally I would enter the Cost first then validate the quanitiy
As stated in many posts - you want to enter the data using a dataport usually the same way & in the same order as you would manually enter it on the form.
And by validating fields like the Item No, Cost & Qty it should fire the code(s) that normally get fired. Such as calculations and the filling of other important fields.
VALIDATE \:D/"Direct Unit Cost":= UnitCost; "Line Amount":= Qty*UnitCost; IF Qty <> 0 THEN BEGIN Quantity:=Qty VALIDATE(Quantity); END ELSE BEGIN CurrDataport.SKIP; END;
If done corretly you shouldn't have to calculate the line amount.
When creating a dataport I always enter 1 line manually & one line thru the dataport and compare them to make sure all the same fields are being filled before I give it the Okey Dokey0
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