Can't set a filter on an Integer table in XMLPorts? Bug?

Miklos_HollenderMiklos_Hollender Member Posts: 1,598
Generally speaking the right way to dynamically set the length of an element list, Integer table, right?

Anyway, basically what happens is that NAV 6.00.29626 ignores the SETRANGE, SETFILTER commands set on the Integer table elements in the OnPreXMLElement - Export and OnAfterGetRecord - Export triggers and gets into an endless loop of trying to read the whole of the Integer table. If I statically set SourceTableView, that works, but cannot be changed dynamically. Even though a MESSAGE - GETFILTERS will show the filter I set in code, the actual number of repeititons is always the SourceTableView, not the code, and if I do not set SourceTableView, endless loop.

I am surely not the first one to try to export data based on the Integer table in V6, so is this really a bug? I

Business case (simplified): <item> <Description> sfdfsdfds <Description> <Description> fsdfds <Description> </EANCODE> </item> - if on the Item Card Description is filled out, create the Description element, otherwise do not create it, if Description 2 is filled out, create a second description element etc.

A workound could be making a temp table on some table with a matching layout and inserting record into it, but I would not prefer that...

Comments

  • DakkonDakkon Member Posts: 192
    That is very strange. I just tested that logic in my local client version 6.00.32012 and it worked just fine. I used the following code in my example XMLport:

    Integer - Export::OnPreXMLItem()
    Integer.SETRANGE(Number,1,5);
    
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    There was something similar, I think it was in version 4, when you set a filter by DataItemTableView and also in OnPreDataItem both were ignored.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Benno67Benno67 Member Posts: 39
    Hi All,

    Of course there is someone else with the same problem, or a simular problem.
    Yes my xmlport also hangs on port.export, but I found out it is caused by using the integer table twice!.
    I tested it, with one time using the integer table it works fine, and it can be controlled form outside the port (setrange), with 2 integer tables it loops, even when the first integer table is controlled by sourcetableview.

    Works fine if I use the sourcetableview property on both integer tables, but it is impossible to control the integer from outside the xmlport, if there are more then one tables used.
    It is not that strange: how can the xmlport “know” from witch codeunit defined integer table it is controlled?

    Benno
  • Benno67Benno67 Member Posts: 39
    First think then post (I am addressing myself).

    The solution is simple: Just add one or more functions to your xmlport to set the control value (glo-from,glo-to).
    On the Export::OnPreXMLItem(), you can do a setrange(number, glo-from,glo-to). :D

    Regard, Benno
  • Miklos_HollenderMiklos_Hollender Member Posts: 1,598
    Benno67 wrote:
    Hi All,

    Of course there is someone else with the same problem, or a simular problem.
    Yes my xmlport also hangs on port.export, but I found out it is caused by using the integer table twice!.
    I tested it, with one time using the integer table it works fine, and it can be controlled form outside the port (setrange), with 2 integer tables it loops, even when the first integer table is controlled by sourcetableview.

    Works fine if I use the sourcetableview property on both integer tables, but it is impossible to control the integer from outside the xmlport, if there are more then one tables used.
    It is not that strange: how can the xmlport “know” from witch codeunit defined integer table it is controlled?

    Benno


    No its not the same. Mine is about it is ignoring filters set right inside the XMLport.
Sign In or Register to comment.