Validate fields when importing data

Draqos
Member Posts: 36
Hi. I am importing sales header and sales line from XL into Navision.
The thing is the XL only has "Sell to customer No." field, an what I want to do is validate it, in order to let Navision check and complete all other fields acording to the customer No..
I have adde code in the OnAfterImport that does this SalesHeader.VALIDATE("sell-to Customer No.")
and now the dataport runs, but it does not actually import any records, even though AutoSave is set to YES. :?
So... SOMEONE HELP ME, PLEASE !!!!
The thing is the XL only has "Sell to customer No." field, an what I want to do is validate it, in order to let Navision check and complete all other fields acording to the customer No..
I have adde code in the OnAfterImport that does this SalesHeader.VALIDATE("sell-to Customer No.")
and now the dataport runs, but it does not actually import any records, even though AutoSave is set to YES. :?
So... SOMEONE HELP ME, PLEASE !!!!
"Simplicity is the ultimate sophistication."
Leonardo DaVinci
Leonardo DaVinci
0
Comments
-
Hi
When I design dataports for importing I always have
AutoSave,AutoUpdate, and AutoReplace set to NO.
Insert and Modify are then set with code on the OnAfterImport trigger along with any Validation, Checks and assignments.From OnLine help for AutoSave
If AutoSave is No, you will have to insert records yourself, by using C/AL code in the OnAfterImportRecord trigger. This is, for example, necessary in situations where you have to perform some processing to decide if the record should be inserted, or to calculate or retrieve additional data before inserting the record.Answer the question and wait for the answer.0 -
Thanx, I do that also....
My problem was with the Navision instalation(or the database). If I close and reopen Navision, for some unknown reason, the dataport works just like it should...
Took some time to figger that out"Simplicity is the ultimate sophistication."
Leonardo DaVinci0 -
May be you run dataport from designer (when you are designing dataport) - data are not commited. Dataport must be run from object designer (list of objects) or from some menu etc. It is standard functionality.0
-
I guess the reason is that, when you are designing a dataport, and run it, no data gets imported.
But when you run the dataport from the object designer, it will.
This let you test the dataport while designing, without any records being created. After the development, you need to run the dataport from the object designer.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
You are right !
I was running the dataport from design mode.
Thanx a lot."Simplicity is the ultimate sophistication."
Leonardo DaVinci0
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