Options

Dataport with 2 tables

foersterfoerster Member Posts: 11
Hi,

I am having a problem with a dataport. I would like to import invoice data from a different programme into table 81 "Gen. Journal Line". In addition I need to import data into table 356 "Journal Line Dimension" as the entries include values for one shortcut dimension. My problem is that the import-file has all the information in one line. How can I tell my dataport that the last field of each recordset belongs into table 356 instead of table 81?

If anybody has an idea I will be glad for any hint.

Best regards,

Jens

Comments

  • Options
    PEzechielsPEzechiels Member Posts: 83
    Hi jens

    Define a global variable and fill it with the value of the last field in your recordset.
    After that you can insert your value into the table using script
  • Options
    foersterfoerster Member Posts: 11
    Hi,

    thanks so far. But I am still having a problem. I based my dataport on table 81. In the OnAfterImportRecord() trigger of "Gen. Journal Line" I put the following code where I refer to table 356:
    "Journal Line Dimension".INIT;
    "Journal Line Dimension"."Table ID":=81;
    "Journal Line Dimension"."Dimension Value Code":=Variable;
    ...
    

    But then I get the message that variable "Journal Line Dimension" is not defined. Any idea where/how I explain Navision that it should refer to another table? Thanks in advance.

    Jens
  • Options
    PEzechielsPEzechiels Member Posts: 83
    hi,

    You have to define a variable and assign the table to it e.g.

    Name Datatype Subtype
    JnlDim Record "Journal Line Dimension"

    then place the following code

    JnlDim.init;
    JnlDim."Table ID":=81;
    JnlDim."Dimension Value Code":=Variable;
    ........
    ........
    ........
    JnlDim.insert;


    Patrick
  • Options
    foersterfoerster Member Posts: 11
    Hi Patrick,

    it works!!! Thank you very much!!!

    Jens
  • Options
    PEzechielsPEzechiels Member Posts: 83
    Glad to help :)

    Patrick
Sign In or Register to comment.