XML Port
aka_USAPA
Member Posts: 62
I have created an XML Port to export Purchase Header & Purchase Line data. I need to run it on the Purchase Order form. Does anyone know how I can filter the XMLPort to run on the current Purhase Order No. (record) I'm in? I would appreciate your help. Thanks.
Another way: http://yourfuture.myshaklee.com
0
Comments
-
Use SETTABLEVIEW in the same way you would filter a report. Set filters on a record variable and then pass it to XMLPORT using xmlport.SETTABLEVIEW.
EXAMPLE:
POHeader.SETRANGE("Document Type",
POHeader."Document Type"::Order);
POHeader.SETRANGE("No.", '000150');
xml1.SETTABLEVIEW(POHeader);There are no bugs - only undocumented features.0 -
With this method, how do I specify the xml fiel name?
xml1.export runs
How do I control the xml file name and destination?Another way: http://yourfuture.myshaklee.com0 -
If you want to specify the file name and export you could do the following:
TestFile.CREATE('C:\XML_CUSTOMER.XML'); //Creates file
TestFile.CREATEOUTSTREAM(TestStream); //Creates stream
//Export
XMLPORT.EXPORT(90000,TestStream);
TestFile.CLOSE; //Close file
MESSAGE('DONE'); //Message once completed
90000 is the port number of the XML Object you are using. TestStream is a variable of type OutStream used to Stream out the data.
Hope this helps..0 -
Yes that helps but how do I filter the xmlport with the current record from the purchase order screen, and still be able to control the output xml file. It looks like if I define an xml variable, I can use the settableview property but after that, I don't know how to specify the xml file output and path.
Also, does anyone know what the SETSOURCE and SETDESTINATION methods are for? There is no documentation for it in Help.Another way: http://yourfuture.myshaklee.com0 -
Hi guys!
Just in case this will be helpful to anybody, here is how I got it to work:
1) Define an xmlport variable
2) Set the table view to the record I want using the SETTABLEVIEW method
3) Set the file name & destination using the SETDESTINATION method (this is the Outstream)
4) Run the xmlport using xml1.EXPORT
It worked like a charm. Thanks for all your help.Another way: http://yourfuture.myshaklee.com0
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
- 329 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