Import Problem-urgent
Navi_Learner
Member Posts: 356
Hi I have a urgent problem. I created a dataport long time ago and we have successfully imported once. But today we tried to import another sales order. It has an error. The following is the error and the code:
/IF "Multiple Ship-to".GET(OrderNo) THEN
IF "Multiple Ship-to".GET(salesheader."No.") THEN
BEGIN
"Multiple Ship-to"."Order No.":=OrderNo;
"Multiple Ship-to"."Sell-To Customer No." := id;
"Multiple Ship-to"."Ship-to Name" :=name;
"Multiple Ship-to"."Line No." := lineno;
"Multiple Ship-to"."Ship-to Contact" :=contact;
"Multiple Ship-to"."Ship-to Address" :=address1;
"Multiple Ship-to"."Ship-to Address 2" :=address2;
"Multiple Ship-to"."Ship-to City" :=city;
"Multiple Ship-to"."Ship-to ZIP Code" := zip;
"Multiple Ship-to"."Ship-to State" :=state;
"Multiple Ship-to"."Ship-to Country Code" :=country;
"Multiple Ship-to"."Shipping Account" :=shippingaccount;
"Multiple Ship-to"."Shipment Method Code" :=methodcode;
"Multiple Ship-to".Notes :=Notes;
"Multiple Ship-to"."Shipping Agent" :=shipagent;
Templine := Templine + 1;
"Multiple Ship-to".INSERT;
Error:
Multiple Ship-to Already Exists, Identification Fields and values Order NO :='' Line No :=10000
Our import file follows the exactly the same order as the dataport fields we created. Please help!!!
/IF "Multiple Ship-to".GET(OrderNo) THEN
IF "Multiple Ship-to".GET(salesheader."No.") THEN
BEGIN
"Multiple Ship-to"."Order No.":=OrderNo;
"Multiple Ship-to"."Sell-To Customer No." := id;
"Multiple Ship-to"."Ship-to Name" :=name;
"Multiple Ship-to"."Line No." := lineno;
"Multiple Ship-to"."Ship-to Contact" :=contact;
"Multiple Ship-to"."Ship-to Address" :=address1;
"Multiple Ship-to"."Ship-to Address 2" :=address2;
"Multiple Ship-to"."Ship-to City" :=city;
"Multiple Ship-to"."Ship-to ZIP Code" := zip;
"Multiple Ship-to"."Ship-to State" :=state;
"Multiple Ship-to"."Ship-to Country Code" :=country;
"Multiple Ship-to"."Shipping Account" :=shippingaccount;
"Multiple Ship-to"."Shipment Method Code" :=methodcode;
"Multiple Ship-to".Notes :=Notes;
"Multiple Ship-to"."Shipping Agent" :=shipagent;
Templine := Templine + 1;
"Multiple Ship-to".INSERT;
Error:
Multiple Ship-to Already Exists, Identification Fields and values Order NO :='' Line No :=10000
Our import file follows the exactly the same order as the dataport fields we created. Please help!!!
0
Comments
-
My guess is there is a duplicated lineno somewhere...NAV - Norton Anti Virus
ERP Consultant (not just Navision) & Navision challenger0 -
No, I checked my import Excel Sheet and there is no duplicate 1000. In the line no column, the number is added 10000 thereafter starting from 10000.
I also tried this. I left the whole column of Line no empty in my import csv file, and then modified my code:
Multiple Ship-to"."Line No." := lineno +10000;
The error is: Multiple Ship-to Already Exists, Identification Fields and values Order NO :='' Line No :=0,
We have 300 records to import and it will be shipped tomorrow. I spent the whole afternoon fixing it, but it didn't work. Appreciate it!0 -
Hi,
Your problem is that you have blank Order No. in your import file.
You can also do the following
instead of"Multiple Ship-to".INSERT;
you could doIF "Multiple Ship-to".INSERT THEN;
Albert0 -
from your line "IF "Multiple Ship-to".GET(salesheader."No.") THEN" i deduce that the primary key of the table is just the "no." field..which means you can only have 1 line per "no."0
-
have you watched it fail through debugger? step through the process and watch how your variables and import values are handled.kind of fell into this...0
-
=D> that's what i was thinking :-kMBerger wrote:from your line "IF "Multiple Ship-to".GET(salesheader."No.") THEN" i deduce that the primary key of the table is just the "no." field..which means you can only have 1 line per "no."
are you sure line No isn't part of the key too?
My guess is that this multiple ship to thing is based on each code being differnet like the Ship-To Address Table.
Is this correct? if so I'm not understanding the Line No thing.
Should be a Customer No & A Code as the key. Perhaps more info on this table is needed.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
