I'm trying to call LaunchApp (function in codeunit 1) to use the send to Word stylesheet option on a standard Navision command button. This function has 3 parametres, two automation (Microsoft XML->v6.0 DOMDocument60) and GUID. I'm doing this (i suppose that this code is ok or there is a error in it?)
IF ISCLEAR(Automation1) THEN
CREATE(Automation1);
IF ISCLEAR(Automation2) THEN
CREATE(Automation2);
StyleSheetId := '{C0E9AC0C-17AA-497A-AA13-3450BA82759D}';
CODEUNIT1.LaunchApp(Automation1,StyleSheetID,Automation2);
But there is a error in the codeunit 682 in the function GetAtributeValue.
Do you know something about it??
0
Comments
In navision 5, this functionality works fine because system automatically creates a xml document before calling this function and assign this xml document to these variable.
The xml variables automation1 and automation2 must represent a xml document.
If you are trying to simulate this functionality of navision 5 , then i can only say BEST OF LUCK.....this is just the first obstacle in your path....
Rec.FINDFIRST;
REPEAT
XMLFile.OPEN(MyPath);
XMLFile.CREATEINSTREAM(XMLInStr);
//Automation1 ->Automation->'Microsoft XML, v6.0'.DOMDocument60
//Automation2 ->Automation->'Microsoft XML, v6.0'.DOMDocument60
CREATE(Automation1);
Automation5.load(XMLInStr);
XMLFile.CLOSE;
IF ISCLEAR(Automation2) THEN
CREATE(Automation2);
RecStyleSheet.SETRANGE("Object ID",21);
RecStyleSheet.FINDFIRST;
CODEUN1.LaunchApp(Automation1,RecStyleSheet."Style Sheet ID",Automation2);
UNTIL Rec.NEXT = 0;
But i've a error in this place:
Codeunit682
GetAttributeValue(DataXML,XPath,AttributeName)
Node := DataXML.selectSingleNode(XPath);
Attributes := Node.attributes;
AttributeNode := Attributes.getNamedItem(AttributeName);
EXIT(AttributeNode.text);
Do you know what is the error??
Have you already found a solution for this ?
I have exactely the same issue.
Kind regards