Steps to import Customers

Hello, I’m getting ready to import customers from a legacy system into navision, however, are there any manuals written on what is the ‘right’ way to import them…are you people using tools for this, to make sure all tables everywhere are populated (for example contacts are populated) Thanks!

I always use the dataports into the customer table with vaildation on and INIT on beforeimportrecord in case of blank fields. The fields are what you need but those I use are: SourceExpr “No.” Name Address “Address 2” City County “Post Code” “Country Code” “Credit Limit (LCY)” “Phone No.” Contact “Fax No.” “Gen. Bus. Posting Group” “VAT Bus. Posting Group” “Customer Posting Group” “Application Method” “Payment Terms Code” “VAT Registration No.” “Type of Supply Code”

Thanks for the response!, that helps me on my way. However, doing a Customer.INIT doesn’t auto create the contact :frowning: in the onbeforeimportrecord trigger

No the INIt is there just to stop rubbish data coming in, for example without it if the record did not have an address 2 address 2 would be populated by the previous record’s address 2. For adding contacts would suggest you use a dataport into the contact table. Alternatives are either put some coding in the on after get record, or creating a dataport for integer table, with varibales for imported record and again coding in the on after get record. Someone else may be able to give a better suggestion

When ever you start a Dataport, specifically if its the first time you have done it on that table, in that database version, the first thing is to understand: The fields; The links; The Internal Validations; The External Validations; (Taking Customer as an example) 1/ create 3 or 4 new customers manually. make sure to populate all the fields you are ging to be using. Then go to object designer, run the table, (21 in this case). Copy paste the records into Excel. 2/ Go to each of the now populated fields, and drill down on every linked or flow field. Learn what its linked to, and learn those relations. 3/ The Time consuming part. Now that you know what the fields are and how they are linked, you need to check what validations there are. In the old days you would do this with the debugger, but its just not practical now. The easiest way is to populate the fields one at a time (the ones that have validation behind them), and after each change, copy paste the record to excel, and go back and compare the changes. As you learn links and validations, add them as comments to your excel spread sheet. 4/ The hard part. Basically you now want to work out which external tables are validated or linked or created by validating fields in the Customer table. (In this case for example, we know that at some point a Contact Card will be created, so we want to find out what we need to do to force that validation, and thus automatically create a Contact. FIrst you need to determine which tables are created. Thats easy. Open Database PInformation Tables, and copy paste to excel. Create a customer with all the required fields, then again copy the Table info, and compare in excel to find which new tabels were created. Now go back and create another customer step by step and work out which trigger creates the contact. Now you also need to work out whcih external tables are modified b triggers in the customer card, and you can either debug, look at code, or do it by trial and error, but generally it will be a combination of all. What you have now done, is learnt about the customer table, and documented (in excel) the required fields, and the validations needed. From here creating the dataport is simple. know that this seems to be a very drawn out process, but along the way, you have also learn’t a lot about Navision. More importantly, if you screw up a dataconversion, it is going to be a huge job to fix it later. And will cost a lot more than investing this way up front. Good luck, and I hope this helps.

Rairo, just to get you started on your way, you could add code something like: {TempContact: VAR::Code20} with customer do begin TempContact := "Primary Contact No."; VALIDATE("Primary Contact No.",''); VALIDATE("Primary Contact No.",TempContact); MODIFY; end; into the dataport, and this should create the Contact records. Also I have moved this to the Beginers forum…

Dataporting is basically an automated data entry process. Any time you want to automate a process that can also be done manually, the easiest way to figure out what is going on behind the scenes is to enter a few manually while running the debugger. That way you can catch calls to external codeunits, do the right validations and those types of things. Open the customer card, turn on the debugger and have at it. Use data that comes from the other system and see if you can use all the fields. And then also do David’s trick and compare records in Excel, that is a very useful trick.