Hi,
Is it possible to poll a file path from Navision CodeUnit every 4 - 5 minutes to find out if any new .xml files have been dropped into the path folder?
When a new file exists I want to trigger an XML Import on it and then delete it. Is there a way to do this does anyone know?
Thanks for any help.
0
Comments
You should be able to find plenty of file examples in this forum.
What lzr is saying is that you can use NAS to run this process as an unattended service on a server computer, so you don't have to depend on an open client session. This would still run the codeunit though, so that part is still the same.
Something else to consider is to write a codeunit that monitors a message queue. The advantage is that this is event driven, so the codeunit reacts to receiving a message. The code itself would be very similar, except that you don't poll a folder, you just process the XML directly.
RIS Plus, LLC
If I went down that route would the XML file have to be "pushed" to the navision server or could I pick it up somewhere else?
The scenario is that I will be sent an XML stream/file to a URL. This stream/file will appear in a folder on our webserver (this is why I was thinking of polling the folder that it is dropped into). IF the code executed by the NAS can monitor a message queue then do you have any suggestions on how I will get the XML from the webserver to the navision server message queue?
At the moment there is no link between the webserver and the navision server as they are not on the same network.
Thank you again.
If you want to do something with MSMQ, then you will have to figure out a way to send the incoming XML document into one, so that Navision can pick it up. Note that Navision can only read from/write to a NON-transactional queue. The queue itself can be anywhere within the domain, as long as the NAS user has access to it.
For XML programming, Navision uses the DOMDocument object model to pick up XML from the queue, you can take a look at the Biztalk codeunits for samples.
RIS Plus, LLC
I will investigate further. \:D/