About IXMLDomNode automation
Ter
Member Posts: 2
Hello,
i read the post about it, but it did'nt helped me, maybe i understood it bad. I try to write me a automation, that i call it and i send a IXMLDomNode to it, there i make changes and send it back to NAV. But when i try to call the function i get a error:
Could not invoke the member XML3.... Unknown error.
The code is:
CREATE(XMLDoc);
XMLDoc.async(FALSE);
CREATE(test);
DOMNode := XMLDoc.createNode(1,'NewNode','');
XMLDoc.appendChild(DOMNode);
DomTextNode := XMLDoc.createTextNode('node1');
DOMNode.appendChild(DomTextNode);
DomNode := test.XML3('TEST', DomNode);
MESSAGE(DomNode.text);
The globals are:
XMLDoc : DomDocument60
DomNode : IXMLDomNode
DomTextNode : IXMLDomText
test : my Automation
t : Text
And the function from my Automation is:
public IXMLDOMNode XML3(String text, IXMLDOMNode nodes)
{
nodes.text = text;
return nodes;
}
If i try to send text to automation and back it works, but no IXMLDomNode
Maybe someone has a tips or idea or the solution for it?
i read the post about it, but it did'nt helped me, maybe i understood it bad. I try to write me a automation, that i call it and i send a IXMLDomNode to it, there i make changes and send it back to NAV. But when i try to call the function i get a error:
Could not invoke the member XML3.... Unknown error.
The code is:
CREATE(XMLDoc);
XMLDoc.async(FALSE);
CREATE(test);
DOMNode := XMLDoc.createNode(1,'NewNode','');
XMLDoc.appendChild(DOMNode);
DomTextNode := XMLDoc.createTextNode('node1');
DOMNode.appendChild(DomTextNode);
DomNode := test.XML3('TEST', DomNode);
MESSAGE(DomNode.text);
The globals are:
XMLDoc : DomDocument60
DomNode : IXMLDomNode
DomTextNode : IXMLDomText
test : my Automation
t : Text
And the function from my Automation is:
public IXMLDOMNode XML3(String text, IXMLDOMNode nodes)
{
nodes.text = text;
return nodes;
}
If i try to send text to automation and back it works, but no IXMLDomNode
Maybe someone has a tips or idea or the solution for it?
0
Comments
-
You need to create a XML Root Element. All nodes you are creating are contained nowhere.
Example:WITH XMLDOMManagement DO BEGIN XMLDocOut.loadXML := '<ROOT/>'; XMLCurrNode := XMLDocOut.documentElement; IF AddElement( XMLCurrNode, 'PROCESS_TYPE', ProcessType, DocNameSpace, XMLNewChild) > 0 THEN EXIT; IF AddElement( XMLCurrNode, 'GUID', GUID, DocNameSpace, XMLNewChild) > 0 THEN EXIT; END;
Sergi Navarro
MCTS: Microsoft Dynamics™ NAV 2009 C/SIDE Solution Development
Visit my Navision Spanish Blog here: http://www.sergisoft.com0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions