Automation Variable Issue

chrisdavis_23
Member Posts: 2
We are working on a project that is taking data out of Navision and dumping it into a xml format. The issue that we have is that we have an "Autmation variable has not been instantiated" and no matter what I change in the CAL Locals to point it to the MSXML it will not get past.
Any suggestions?
Any suggestions?
0
Comments
-
Why not follow the pattern in the XML Codeunits -- they work roughly as follows:
Declare XMLDOMDocument as 'Microsoft XML, v3.0'.DOMDocument
Declare CurrNode as 'Microsoft XML, v3.0'.IXMLDOMElement
Declare NewChild as 'Microsoft XML, v3.0'.IXMLDOMElementPROCEDURE ExportPO(PurchHdr,PurchLin) BEGIN CREATE(XMLDOMDocument); XMLDOMDocument.loadXML := '<PurchaseOrder/>'; CurrNode := XMLDOMDocument.documentElement; // begin a 'Header' element... NewChild := CurrNode.ownerDocument.createNode('element', 'Header', ''); CurrNode.appendChild(NewChild); // add child elements to the 'Header' element... CurrNode := NewChild; NewChild := CurrNode.ownerDocument.createNode('element', 'Document_Number', ''); NewChild.text := PurchHdr."No."; CurrNode.appendChild(NewChild); NewChild := CurrNode.ownerDocument.createNode('element', 'Buy_from_Vendor', ''); CurrNode.appendChild(NewChild); // add child elements to the 'Buy_from_Vendor' element... CurrNode := NewChild; NewChild := CurrNode.ownerDocument.createNode('element', 'Number', ''); NewChild.text := PurchHdr."Buy-from Vendor No."; CurrNode.appendChild(NewChild); NewChild := CurrNode.ownerDocument.createNode('element', 'Name', ''); NewChild.text := PurchHdr."Buy-from Vendor Name"; CurrNode.appendChild(NewChild); {...} // done with 'Buy_from_Vendor' child elements // move back to the parent to add more 'Header' elements... CurrNode := CurrNode.parentNode; {...} // done with the 'Header' element -- add 'Line' elements ... CurrNode := CurrNode.parentNode; IF PurchLin.FIND('-') THEN REPEAT NewChild := CurrNode.ownerDocument.createNode('element', 'Line', ''); CurrNode.appendChild(NewChild); // add 'Line' element children... CurrNode := NewChild; NewChild := CurrNode.ownerDocument.createNode('element', 'Line_Number', ''); NewChild.text := FORMAT(PurchLin."Line No."); CurrNode.appendChild(NewChild); {...} CurrNode := CurrNode.parentNode; UNTIL PurchLin.NEXT = 0; // done, save it... XMLDOMDocument.save('c:\PurchaseOrder.xml'); END
The xml file looks something like this:<PurchaseOrder> <Header> <Document_Number>1001</Document_Number> <Buy_from_Vendor> <Number>10000</Number> <Name>London Postmaster</Name> </Buy_from_Vendor> </Header> <Line> <Line_Number>10000</Line_Number> </Line> </PurchaseOrder>
0 -
Before using the automation object begin with:
CLEAR("Automation VAR Name");
CREATE("Automation VAR Name");0 -
chrisdavis_23 wrote:We are working on a project that is taking data out of Navision and dumping it into a xml format. The issue that we have is that we have an "Autmation variable has not been instantiated" and no matter what I change in the CAL Locals to point it to the MSXML it will not get past.
Any suggestions?
Is this at runtime or at compile-time? The reason I ask this is that if it is at runtime it may be something as simple as you referring to a node that doesn't exist in the xml-document. It will in my experience give that rather misleading error message.Best regards
Tommy0 -
hi there
I try to save whole tables in the same way as you done above..
and for a similar one it works - but when I start to safe all tables I got a memoryproblem.
I create an XML object, adds all content of a table in it and safe it and if it's an big tabe i splitt it to several files. Everthing works fine but as longer as the codeunit runs as bigger is the RAM that's neede even a table was saved and the object cleard. Looks like navision doesn't gives requested memory not complettle back..
Any Ideas?? Suggestions??
Thanks
Christoph0
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