Hi,
Newbie question here.
We are helping a customer migrating from another ERP system to Dynamics NAV 6. We are able to extract data from the old system into .csv files, which we will then import into NAV 1:1. The client has asked if it would be possible for us to not include data marked with a * infront of the name in the name field - this includes customers, Vendors, Items, etc. It's not something we have recommended them to do, but this has been their way of marking "dead" data for years.
So, have succesfully created the dataport for import, but not sure how I would do the code for excluding data starting with * in the name field. Any hints please?
/G
Comments
Also, try to ask them if they want to maintain these items/customers as blocked items/customers in their new nav database...it would be better, especially if you're going to bring the item ledgers etc. in nav
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thanks a lot for the explanation.
I agree with your observation that it is not a good idea to use the * to mark certain data. I will ask the client if it's possible for them to use a different marking.
I will also take into consideration your suggestion about blocking the customers/vendors/items/etc.
Just for fun I decided to go ahead and try out your suggestion in a dataport. I'm importing data into table 18 (Customer). The lines I'm importing looks something like this:
No.;*Companynameexample;Addres 1;Address 2;City;Etc...
In the dataport I put in the folowing code to see if your suggestions worked (and it did :
Customer - OnAfterImportRecord()
IF Name = '*Companynameexample' THEN
CurrDataport.SKIP;
Remaining thing is, that I need to make a filter excluding all customers starting with *, and I'm not sure how to code such a condition. In words it should look like this:
IF Name begins with * THEN
CurrDataport.SKIP;
Anyine has a hint or example for me?
/G
anyway, if you search "search substring" in the online help, you'll find STRPOS function, that fits your needs...
BTW, you should study some more before implementing such things...be careful and possibly ask a senior developer to give you an hand
EDIT: you can also use COPYSTR, or even better (this is more advanced)
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog