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.
0
Comments
EXAMPLE:
POHeader.SETRANGE("Document Type",
POHeader."Document Type"::Order);
POHeader.SETRANGE("No.", '000150');
xml1.SETTABLEVIEW(POHeader);
xml1.export runs
How do I control the xml file name and destination?
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..
Also, does anyone know what the SETSOURCE and SETDESTINATION methods are for? There is no documentation for it in Help.
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.