XMLPORT(Export) save in a destination automatically
bassouma
Member Posts: 12
Hello everyone,
I create an XMLPORT to export some information from navision 2013 R2, I want when i run the XMLPORT, it will saving automaticaly in a destination that it is alreadey setup.
How can i do this?
I write this in OnPreXmlPort:
currXMLport.FILENAME(InterfaceSetup."Export Contract Comete Folder" + FileName + '.csv');
But when i run i have the dialog box to save.
I would like that should saving automatically in this folder.
I create an XMLPORT to export some information from navision 2013 R2, I want when i run the XMLPORT, it will saving automaticaly in a destination that it is alreadey setup.
How can i do this?
I write this in OnPreXmlPort:
currXMLport.FILENAME(InterfaceSetup."Export Contract Comete Folder" + FileName + '.csv');
But when i run i have the dialog box to save.
I would like that should saving automatically in this folder.
0
Comments
-
You need to use an OutStream variable to export automatically the file generated by XmlPort, running the process it from a calling codeunit. For instance:
IF EXISTS(XmlFileName) THEN ERASE(XmlFileName); XmlFile.CREATE(XmlFileName); XmlFile.CREATEOUTSTREAM(OutStreamVar); XMLPORT.EXPORT(XMLPORT::"Your XmlPort",OutStreamVar); XmlFile.CLOSE;
* Daniele Rebussi * | * Rebu NAV Diary *0 -
When i create this file(.csv).
If Exist(XmlFileName)
I don't like to ECRASE it I would like to create another with a postfix variable.
How can i do this ?0 -
Change the code in:
XmlFileName := 'Outputfile'; XmlFileNameExt := '.xml'; IF EXISTS(XmlFileName + XmlFileNameExt) THEN XmlFileName += '_1'; XmlFile.CREATE(XmlFileName + XmlFileNameExt); XmlFile.CREATEOUTSTREAM(OutStreamVar); XMLPORT.EXPORT(XMLPORT::"Your XmlPort",OutStreamVar); XmlFile.CLOSE;
In case insert the the file check in a repeat-until loop to find a proper suffix to use.* Daniele Rebussi * | * Rebu NAV Diary *0 -
With This:
IF EXISTS(XmlFileName + XmlFileNameExt) THEN
XmlFileName += '_1';
I will have all the time XmlFileName + '_1' but i want that the first time it 1, the second 2,3,4..0 -
REPEAT Suffix += 1; XmlFileName := 'Outputfile_' + Suffix + '.xml'; UNTIL (NOT (EXISTS(XmlFileName)));
* Daniele Rebussi * | * Rebu NAV Diary *0 -
Thanks
0 -
Hi geordie,
Have some filters in XML port, but when i running it from codeunit able to export the file to a particular location but not able to set the filters in XML . is there any solution to set the filters of XML-Port when running form codeunit.0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 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
