XML import with additional trigger code question

KisuKisu Member Posts: 381
Heyas,
I'm importing some data via XML port and was thinking if its possible to do this?:

Resolution:
You have xml port and the xml file where to import.
You have table for the port fields.
You have codeunit to trigger the port stream.

The xml file has row information.
During after row is added a XML trigger would add a an additional data on the xml port table's row which the stream just populated.

example:
after stream runs first row
[empty field in the table], [field 1 date or something],[ field 2 some data]

after trigger the addional data
[the additional data], [field 1 date or something],[ field 2 some data]


Sorry, I hope you know what I mean. I try to rephrace it if needed :mrgreen:
K.S.

Answers

  • kinekine Member Posts: 12,562
    Check for trigger

    <ElementName> - Import::OnBeforeInsertRecord()

    which is on element of type Table in the XMLPort. There is the point where you can add some data into the record before it is inserted into table.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • KisuKisu Member Posts: 381
    kine wrote:
    Check for trigger

    <ElementName> - Import::OnBeforeInsertRecord()

    which is on element of type Table in the XMLPort. There is the point where you can add some data into the record before it is inserted into table.

    How do I refer it to the current line its inserting if I want to get and add a data from another table.

    if I use GET from the other table
    do I need to give the xml port a varable for that table where is the current row and := to it?
    K.S.
  • kinekine Member Posts: 12,562
    You do not need to add any variable. It is there and have same name as the table element. Just look into the Symbol menu...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • KisuKisu Member Posts: 381
    kine wrote:
    You do not need to add any variable. It is there and have same name as the table element. Just look into the Symbol menu...
    Ah thanks, didnt notice it :)
    K.S.
Sign In or Register to comment.