Are You Using Copy & Paste in Dynamics NAV? You Should!
Our support team is frequently asked to develop import functions to pull Excel data into Dynamics NAV. In some cases, the development of dataports or XMLports is necessary, however, as an alternative, I increasingly see users taking advantage of copy and paste in Dynamics NAV. Copy and paste has been enabled since the Dynamics NAV 2013 release and is most commonly used for populating journals. Once data is copied from Excel, right-clicking in the leftmost cell of the first row of an empty journal should yield the “Past Rows” option within NAV.
Tips and best practices for Copy and Past in NAV I’ve compiled over the years:
1) Excel columns must mimic the NAV page columns you are pasting into
NAV assumes that the data copied from Excel will have both the same columns and column order as the NAV page you are pasting into.
2) Header information should not be pasted
NAV is not expecting a header row from Excel. Copy raw data only. For example, row 1 below should not be copied from Excel.
3) Let NAV do the heavy lifting
Because NAV now validates each field that you paste into it, there is a lot more going on than you may think as the paste occurs. A few examples:
a. NAV won’t let you paste bad data into it. For example, NAV would throw an error if you tried to paste descriptive text into the “Account No.” field since no such account exists. In the example below, I’ve mistakenly tried to paste the text “APPLE” into the “Account No.” column of NAV’s general journal.
b. NAV will give a warning if you are trying to paste more characters than are allowed per a given field. In the example below, I’m trying to paste 60 characters of text into NAV’s 50-character “Description” field. Note that NAV will give notification prior to truncating your data.
As a general rule, organize your Excel columns in the same order that you’d manually enter data into the NAV journal because the system will validate your data from left to right. For example, you’d want the “Account Type” column positioned to the left of the “Account No.” column in Excel. This way NAV is aware of what type of account (G/L Account, Customer, Vendor, Bank, etc.) you are passing into the “Account No.” field.
Also, consider a case where you want to control the dimension values within the journal. Because NAV will try to automatically set dimension values based on default dimension rules as fields are validated, you’d want to make sure to place the dimension columns to the right (the end) of the Excel file. That way, the dimensions of your file will trump any other dimension values that were set during validation of earlier fields.
Under the covers, NAV will autofill other relevant fields as it validates pasted data. Consider a case where a customer number is pasted into the “Account No.” column of a journal. Due to validation code, NAV will also automatically populate many other fields relevant to that customer (description, payment method, customer posting group, payment terms, etc.).
4) What to do if you don’t see “Paste Rows” as an option
If you run into a situation where the “Paste Row” option is not visible, this most likely indicates that the PasteIsValid table property needs to be changed in the underlying table. This setting can easily be changed by your NAV support resource.
Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.
Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.