Newbie dataport problem

2»

Comments

  • stanley
    stanley Member Posts: 9
    how to import data from excel or access in navision?
    pliz help
    thanx [-o<
  • Ilona
    Ilona Member Posts: 44
    Hi Stanley,

    You can import data through a dataport. Search here in the forum on dataport and you will find lots of information. Thats how I started too.

    Good luck!
  • jversusj
    jversusj Member Posts: 489
    Ilona,

    I guess today is the day?

    I just want to clarify where I meant for you to go to "delete" no series. The first thing to consider is that you have system set-up and you have journal set-up.

    System set-up would be your no. series definitions themselves. It starts with XXXX and ends with ZZZZ and the last used was XXXY and manual numbers are allowed (Y/N), etc.

    Journal Set-up is where you can specify which no. series you intend to use per Journal Batch. When you go to your job journal and select the journal batch name, you should be presented with a form showing available journal batches. here you should see columns for no. series and posting no. series (show/hide as needed). When you leave these fields blank, the user controls what the doc no will be on entry AND on posting.

    I have double checked where i have seen this before, and confirmed this does work. I have imported to item journal to load initial inventory and wrote an import to enter Payroll entries to a General Journal (we don't have the payroll module but the entries must be reflected in the G/L). In both cases, defining the journal batch without a no. series (or a posting no. series) let me push in my imported values.


    Here is what I used, data item = integer. Some stuff happens in other triggers mainly for clean-up, etc.
    [i]..earlier i purged whatever was in this journal to avoid same file from being imported more than once in error[/i]
    //Now we need to begin creating the journal lines. The first record in the import file will be line 10000. (i omit this logic below)
    //Subsequent line nos will be incrementally increased by 10000.
    
       GenJrnlLine.INIT;
       GenJrnlLine.VALIDATE("Journal Template Name",'GENERAL');
       GenJrnlLine.VALIDATE("Journal Batch Name",'XX');
       GenJrnlLine.VALIDATE("Source Code",'GENJNL');
       GenJrnlLine."Line No." := TempLineNo;
       GenJrnlLine.VALIDATE("Posting Date",InPostDate);
       GenJrnlLine.VALIDATE("Document No.",InDocNo);
       GenJrnlLine.VALIDATE("Account Type",GenJrnlLine."Account Type"::"G/L Account");
       GenJrnlLine.VALIDATE("Account No.",InGLAcct);
       GenJrnlLine.VALIDATE(Description,InDescription);
       GenJrnlLine.VALIDATE("Shortcut Dimension 1 Code",InDept);
       GenJrnlLine.VALIDATE(Amount,InAmount);
       CLEAR(GenJrnlLine."Gen. Prod. Posting Group");
       IF GenJrnlLine.INSERT THEN BEGIN
          //line created without problem
          Counter += 1;
       END ELSE BEGIN
          MESSAGE('Error creating journal line for %1 %2 %3 %4',InGLAcct,InDept,InDescription,InAmount);
       END;
       TempLineNo += 10000;
    

    maybe this helps you?
    kind of fell into this...
  • Ilona
    Ilona Member Posts: 44
    Hi all,

    Still it isn't working complete. I already discovered the problem, but cannot solve it.
    In Job Journal the lines are displayed the way they should be.
    As soon as I press F11, it's complaining about the Dimension Value Code.
    The right code for that record is displayed, but when pressing Ctrl+Shift+D , there appaers a table that should be filled. But it isn't. I guess there is a validate problem. ](*,)
  • Mbad
    Mbad Member Posts: 344
    Can be corrected by inserting as soon as you have filled the primary key fields. Then the validates on fields that create dimensions will fill out the underlying table.

    Oh and try manually typing in the line so you have something to compare agains.
  • Ilona
    Ilona Member Posts: 44
    thank you for your quick reply!
    When typing that line manually, it works fine.

    Uhm, how do I set the primary key in that dataport? :shock:
  • Mbad
    Mbad Member Posts: 344
    Just move your insert(true) to right after Journal Template Name,Journal Batch Name,Line No. has been filled out. Then the line is in the database and validates then works as if you typed it in.
    The primary key is in the table, and is what keeps every line unique.
  • Ilona
    Ilona Member Posts: 44
    :roll: I added the INSERT(True)
    I guess the lines are unique now, because I'm getting this error message now:

    The Job Journal Line Already exists
    Identification Fields and Values:
    Journal Template Name='PROJECT', Job Journal Batch Name = 'CHANTALLE', Line No.= 0

    Is it a kind of reset problem?
  • Mbad
    Mbad Member Posts: 344
    AFTER you insert the line no :-)
  • Ilona
    Ilona Member Posts: 44
    OK, AFTER now ;-)

    [-o< But now the next error message is appearing:

    Qty. per unit of Measure must not be 0 in Job Journal Line Journal Template Name=",Journal Batch Name=",Line No.='0'.
    :?
  • Mbad
    Mbad Member Posts: 344
    Looks like you are validateing Quantity on an empty line. Use debugger to see what goes wrong. 1 thing is for sure: primary key fields are not filled out, or not inserted.
  • Savatage
    Savatage Member Posts: 7,142
    Well if your line no always starts with 10000 - you know the import is happing wrong.

    Another easy way is to set all your fields to Variables and import them in the order you want.

    for example

    instead of "Account No" you can make a var called AcctNo.
    make AcctNo your dataport field and
    on import record
    "Account No" :=AcctNo;
    "Posting Date" := PostDate;
    "Source Code" := SourceCode;
    next variable
    next variable
    etc
    Bringing them in in the order that they are needed and validating those that need to be validated.

    :lol: - hang in there - once you finish this all other dataports will seem like a breeze!
  • Ilona
    Ilona Member Posts: 44
    thank you savatage, I'll give it a try and lett you know!
    thx for cheering me up :D