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

Miklos_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...
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...
0
Comments
-
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 railgun0 -
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."0
-
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?
Benno0 -
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).
Regard, Benno0 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions