Multiple Dataitems in Dataport

NavNewUser
NavNewUser Member Posts: 2
Hi,

I am trying to create a dataport to import Gen. Journal Line from csv file into NAV with the global dimension value selected. I have created a dataport to include dataitems Gen. Journal Line and Journal Line Dimension. The dataitemseparator is set as default (i.e. <<newline><newline>>, however even when I insert a blank line in my csv file, NAV doesn't seem to recognize the separator and is still looking for the required field in the 1st dataitem (i.e. Gen. Journal Line).

Is there anyway I can create a dataport to import general journal lines with the global dimension value pre-selected?

Any comment will be greatly appreciated. I have been looking at this for 2 days and still couldn't find a solution!

Comments

  • kriki
    kriki Member, Moderator Posts: 9,121
    You need to put the dimensions of the journal line on the SAME line as the journal line in global variables and in the OnBeforeImportRecord-trigger you need to clear those variables and in the OnAfterImportRecord-trigger you need to save them.

    In case you want to use multiple dataitems, you need to put first ALL journal lines, then leave a blank line and THEN you can put ALL dimensions of ALL journal lines.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kine
    kine Member Posts: 12,562
    And if you are importing just 2 dimensions (you wrote about global dim...), you need to insert the record through Code. Because you need to insert the line first (assigning PK fields like Template and Batch code and line no.), after that validate the other fields including Dimension shortcut 1 and 2 and call Modify(true) on the record. In this way the Journal Line dimension table will be filled correctly.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Savatage
    Savatage Member Posts: 7,142
    Off Topic Tangent-> If your new to nav and before you get rolling, you might want to think about how you or your customer is going to use dimensions so you won't ahve to read posts like this years down the road..

    :mrgreen:http://www.mibuso.com/forum/viewtopic.php?t=25604