How to export singular PO information as XML

compwizard
Member Posts: 17
Very simple request which is baffling me ..
All I want to do is when a PO is posted (and Receive is selected as the posting option) I wish to record the data within the posted PO as an XML file.
IF EXISTS('C:\temp\XML_CUSTOMER.XML') THEN
ERASE('C:\temp\XML_CUSTOMER.XML');
POFile.CREATE('C:\temp\XML_CUSTOMER.XML'); //Creates file
POFile.CREATEOUTSTREAM(POStream); //Creates stream
XMLPORT.EXPORT(8000,POStream);
POFile.CLOSE;
Works well, but I obviously end up with everything.
I know I need to use SETRANGE and probably record the appropriate Document Number, but just can't get my head round it! HELP! ](*,)
All I want to do is when a PO is posted (and Receive is selected as the posting option) I wish to record the data within the posted PO as an XML file.
IF EXISTS('C:\temp\XML_CUSTOMER.XML') THEN
ERASE('C:\temp\XML_CUSTOMER.XML');
POFile.CREATE('C:\temp\XML_CUSTOMER.XML'); //Creates file
POFile.CREATEOUTSTREAM(POStream); //Creates stream
XMLPORT.EXPORT(8000,POStream);
POFile.CLOSE;
Works well, but I obviously end up with everything.
I know I need to use SETRANGE and probably record the appropriate Document Number, but just can't get my head round it! HELP! ](*,)
0
Comments
-
It's similar to running a report for a specifc record.
Option 1
Use the third, optional, parameter for the record set.
XMLPORT.EXPORT(Number, OutStream [, Record])
ExamplePO.SETRECFILTER; XMLPORT.EXPORT(8000,POStream,PO);
Option 2
Declare XML Port as a variable "POExport"PO.SETRECFILTER; POExport.SETTABLEVIEW(PO); POExport.SetDestination(POStream); POExport.RUN;
0 -
That's great
Thanks for the help.
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