XML DOM Management Automation error

jversusj
Member Posts: 489
Hello all,
I searched the forum and didn't find anything quite on point for my issue.
I am trying to figure out how to code using XML DOM. I have been progressively increasing the complexity of the XML file I am creating, attempting to build the file one piece at a time, using the nesting and grouping I require.
My dataset is based on a single table with 5 fields. I need to group on 4 of these fields, so I am using some filtering of the record set to loop. I have to group on Division, Category, SubCategory, and Family, with the fifth field = Item No. I need to create an XML file that will output all Division records by category by sub-category by family. XMLPorts did not seem sufficient for the task.
I have a loop that executes 3 times (for a filtered record set of 5 items in the second filtered category), but at the start of the fourth loop, I get the error:
If I comment out the loop and let the code run once, everything is okay (although I do not output my full data set), and I get the XML output for 2 items in the first category.
When I watch during debugger, the error is occuring in the AddElement function of CU 6224:
any ideas?
How can it be instantiated for the preceding iterations of the loop and suddenly not be at the start of the 4th loop? Thanks!
I searched the forum and didn't find anything quite on point for my issue.
I am trying to figure out how to code using XML DOM. I have been progressively increasing the complexity of the XML file I am creating, attempting to build the file one piece at a time, using the nesting and grouping I require.
My dataset is based on a single table with 5 fields. I need to group on 4 of these fields, so I am using some filtering of the record set to loop. I have to group on Division, Category, SubCategory, and Family, with the fifth field = Item No. I need to create an XML file that will output all Division records by category by sub-category by family. XMLPorts did not seem sufficient for the task.
I have a loop that executes 3 times (for a filtered record set of 5 items in the second filtered category), but at the start of the fourth loop, I get the error:
--------------------------- Microsoft Dynamics NAV --------------------------- This message is for C/AL programmers: This Automation variable has not been instantiated. You can instantiate it by either creating or assigning it. --------------------------- OK ---------------------------
If I comment out the loop and let the code run once, everything is okay (although I do not output my full data set), and I get the XML output for 2 items in the first category.
When I watch during debugger, the error is occuring in the AddElement function of CU 6224:
NewChildNode := XMLNode.ownerDocument.createNode('element', NodeName, NameSpace);The variables (in debugger) appear as they do in the preceding 3 iterations of the loop, which appear to work fine.
any ideas?
How can it be instantiated for the preceding iterations of the loop and suddenly not be at the start of the 4th loop? Thanks!
kind of fell into this...
0
Answers
-
I may have solved this, or at least got moving again... I removed a CurrNode := currNode.ParentNode which I had several in place to traverse back up to a higher grouping level.kind of fell into this...0
-
It is automation error a big problem to the company..
how cam automatically resolve it?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