NAV 4.0 Export Data in XML File using XMLPort

dipakpatel2505
Member Posts: 169
Dear All,
In Nav 4.0, I have trying to export Customer List in XML file Format using XMLPort and Codeunit.
I am facing problem and not able to export data in XML file in Nav 4.0. Navision crashes when I try to export data in XML file using code as below: I have also attached XML Port design snapshot.
I have tries same code in Navision 2009 R2 and it has export XML File successfully. Is it XML Port Limitation in Nav 4.0 that it can not export data in XML Format. Any suggestion/help to solve my problem is appriciate.
Codeunit : OnRun() Trigger
IF EXISTS('D:\Test\Customer.xml') THEN
ERASE('D:\Test\Customer.xml');
CLEAR(TestFile);
CLEAR(TestStream);
XMLFileName := 'D:\Test\Customer.xml';
TestFile.CREATE(XMLFileName);
FileOpened := TestFile.OPEN(XMLFileName);
TestFile.CREATEOUTSTREAM(TestStream);
CustomExport.SETDESTINATION(TestStream);
CustomExport.EXPORT;
TestFile.CLOSE;
MESSAGE('XML Customer Export Complete.');
In Nav 4.0, I have trying to export Customer List in XML file Format using XMLPort and Codeunit.
I am facing problem and not able to export data in XML file in Nav 4.0. Navision crashes when I try to export data in XML file using code as below: I have also attached XML Port design snapshot.
I have tries same code in Navision 2009 R2 and it has export XML File successfully. Is it XML Port Limitation in Nav 4.0 that it can not export data in XML Format. Any suggestion/help to solve my problem is appriciate.
Codeunit : OnRun() Trigger
IF EXISTS('D:\Test\Customer.xml') THEN
ERASE('D:\Test\Customer.xml');
CLEAR(TestFile);
CLEAR(TestStream);
XMLFileName := 'D:\Test\Customer.xml';
TestFile.CREATE(XMLFileName);
FileOpened := TestFile.OPEN(XMLFileName);
TestFile.CREATEOUTSTREAM(TestStream);
CustomExport.SETDESTINATION(TestStream);
CustomExport.EXPORT;
TestFile.CLOSE;
MESSAGE('XML Customer Export Complete.');
0
Comments
-
Dipak,
Did you find any solution for this issue.
We are facing the same issue.Regards,
Manish0 -
Is your code the same as Dipak's? If so then try deleting the following line of code...
FileOpened := TestFile.OPEN(XMLFileName);
...I'm not sure if that is the problem or not (maybe it opens the file in read only mode) but it shouldn't really be there.
If that doesn't fix it then show us the code you are using and highlight which line of code is causing the crash (you can use the debugger to step through the code).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