How to call LaunchApp for use with Stylesheet

gonzy1981
Member Posts: 156
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??
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
-
You are getting error because automation1 and automation2 variables are empty.
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....0 -
Ok i understood it, i'm going to try it in the classic client.0
-
I'm doing this:
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??0 -
Dear,
Have you already found a solution for this ?
I have exactely the same issue.
Kind regards0
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