Options

RecRef in XMLport

NS5NS5 Member Posts: 2
Hey,

a few month ago i started coding with NAV 2015.
The last 8 years i just worked with NAV 4.50 to 2009 R2 CC, so some stuff is a little bit new for me :wink:
So i have a little basic question about XMLports:

Is it possible to export table data i dont define in the XMLport designer previously ?
For example, i have the following table with one field (TableID):

TableID
470
471
18

Now i want that the XMLport run through that table and export all the data from table 470, table 471 and so on.
Can i realize that with RecRefs or something like that ?

Big thanks in advance.

NS5

Comments

  • Options
    matttraxmatttrax Member Posts: 2,309
    Probably not the way you are thinking about it. You have to have a value in either a field or a variable and that field or variable has to be explicitly stated in the XMLport designer. The only way I can see this working with RecRefs is to write code to concatenate a text variable (you can have unlimited length text now).
  • Options
    kinekine Member Posts: 12,562
    All depends on how you will create the XMLPort. You can base it over Integer table and set the values of your elements through code. It is same like when you will want o do same in dataport in older versions...

    Or you can use DotNet interop and do the same through XMLDocument class... as you will do it when using C# or something else..
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    NS5NS5 Member Posts: 2
    At first, thanks for your answers :)

    Little note: I wrote a codeunit with an MSXML automation to ex - & import data from NAV.
    To check different ways i just want to try if i can realize this with an XMLport.
    All depends on how you will create the XMLPort. You can base it over Integer table and set the values of your elements through code.

    I dont know if i understand this correctly. How do you trigger the XMLport to export the values after i ran over the Integer table ? I have an Integer table with an entry '18'. Then i fill an RecRef with the values from this table. In the last step i want to export this data but neither i cant define the RecRef as an XMLport Data Source, nor i can use any function or trigger to do so. I think i dont understand this correctly, sorry, so do you have an example for the procedure you have in your mind ?
  • Options
    kinekine Member Posts: 12,562
    Create the Element with source type Table, data source Integer. Than create nodes of type text as you wish for the data. In OnAfterGetRecord you can prepare the data for each record you want to export and in OnBeforePassVariable you can assign the value to the node. You can combine this as you wish into more dataitems (e.g. to loop through tables and records and their fields...). It is nearly same like using Integer in report for outputing the temp table...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.