Hi,
I have just found an interesting "undocumented feature" in Navision.
I had a table with following fields:
Field1,Field2,Field3
I had also a dataport with the same fields for this table. So I have done a comma-separated file:
1,f1,f2,
2,f3,
3,f5,f6,
4,,
Here is what appears to be populated in the table after dataport was run:
Field1 Field2 Field3
1 F1 F2
2 F3 F2
3 F5 F6
4 F6
Interesting....... :-k
So line 2 has the same value for the Field3 as the line 2! So dataport does not clear record after each record and keeps the old record.
Notice that the same happened to the last record as well(the value for Field3 came from line 3). But it looks like this only happens to the last field because value for field2 for the line 4 was not brought down from the line 3!
I did some more testing on it and discovered that if there is a space in the file after last comma, dataport works fine.
I think that can be very dangerous when importing lots of data and some fields at the end of the line can be blank.
I quess I will have to add clearing of the record to all dataports.........
Best Regards,
Oleg
0
Comments
Oleg
The "traditional" approach is putting an INIT into the OnBeforeImport.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Oleg
RIS Plus, LLC
The basic idea is to import data to intermediate tables and write code to check up all the possible problems (missing relations etc.) and also review manually the damage done by the combined efforts of Excel and Navision (such as Excel turning integers into dates and dates into hell-knows-what).
One funny story. I had a client who copy-pasted e-mails into comments, and therefore Enter, Tab, semicolon, everything was there. How does one set field and record separators in this case? This is when Buddhism comes handy: I invented the SSV file format - Sanskrit Separated Values. PRATITYA-SAMUTPADA for record separators, MADHYAMIKA-KARIKA for field separators. It worked
that's still not good enough, because if you got f.e. starting inventory for 100 000 Items and 100 Items are missing from Item master data - which would be a very good ratio, indeed, only 0,1% error - then it stops 100 times. This is why I think importing to intermediate tables is better.
RIS Plus, LLC
To the point though, I just happen to think that you don't NEED to import inventory info into staging tables. You import inventory information into an Item journal, and then you check the numbers, and then you run the posting routine. The journal is already an intermediate table, why would you want to import it into a third one? It is redundant.
Besides, it's not the import process that determines the outcome of datamigration, it's the check for balances after the info is posted. If that number is not correct, then it doesn't matter if you imported using staging tables or directly.
RIS Plus, LLC
Although importing into a staging table is okay as well, but to me, it seems like an extra step.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
No one way is better than the other. It's whatever you're used to.
Programming dataport itself is "empty". Miklos, you should know what I mean.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I love this job, figuring out what the best way to do something is
RIS Plus, LLC
- missing Items "Oh, you need that too? They haven't been sold for year!"
- missing Locations "Oh, you need that too? They are just scrap locations."
and so on.
Another thing is that Excel always messes things up, but that may be just a local problem (Excel just wants to be "too local" in understanding data formats) and sometimes it's hard to figure out when a DataPort stops that 32182 is a malformed date by Excel.
The point being that both approaches have their time and place. I am certainly going to take a closer look at your data migration tools next time I need to migrate data.
RIS Plus, LLC
Now, I think many people have this problem all over the world. Many recently graduated junior analyst - like I was in 2002 - are sitting right now before Excel and try to massage data to be imported into some ERP system, late at night, without success.
How could we broadcast to them the message all over the world that "Hey, forget Excel, it's development work. Not only in Navision, but everywhere: for example, this is why the Unix folks created the Perl language for. So it's clearly a development task. Forget Excel."
Or is it yet another thing that everybody can learn from is own mistake by sleepless nights? Could we somehow help them in it?
Analysts can do this too, as long as they have a good technical understanding on a development detail level, you know. They must be able to unravel a process into all of the steps that it takes to accomplish a task with programming code.
RIS Plus, LLC
[1] Which is a good idea I think.
You could also import it into staging tables
RIS Plus, LLC
RIS Plus, LLC