I am running the XMLPort from the Development Center.
After I run it the popup from the client opens where I can view or download the file. That file is not empty and contains the relevant data.
I need the file to be automatically downloaded to my local directory everytime the XMLPort is run. For that I added the following lines of code in the XMLPort C/AL Editor:
OnPreXMLport()
CustXmlFile.CREATE('C:\Temp\data.txt');
CustXmlFile.CREATEOUTSTREAM(XmlStream);
XMLPORT.EXPORT(50002, XmlStream);
CustXmlFile.CLOSE;
Now if I run the XMLPort again, the popup in the client shows up as usual and at the same time a file is created in my local directory. The file although is empty.
Thanks for your help