Hello,I´m investigating the possibilites for our company to accept electronic salesorder. Were running Navision 3.6 Native DB and have a working NAS.
Is it possible to for example accept xml-file from outside, let NAS post the xml to new salesorder?Which CU posts the sales order?
Or, what is the right way to implement this scenario?
With version 3.6 you don't have the XML Port so in order to do the XML import probably (I don't remember exactly) the only way is to use the dataport with the XML User Portal file format. What you mean with "post the order" exactly? You mean post the shipment, post the invoice or simply insert the order in NAV?
Marco
Marco FerrariCronus.it
I mean to insert order in database.
Yeah I know I cant use xml-ports in 3.6. I have recently used automation DOM-documents. I should be able to use that.
If you want to just insert the order unfortunately you cannot use dataport under NAS so the only possible choice is to write a codeunit. Another thing you can do is to convert the database into a newer version of NAV so that you have XML port objects available (upgrading the customer license). I'm talking about the conversion only (open the database with a 5.00 SP1 client and convert it).
Ok. If I write codeunit to insert order in database. Will I just do an insert in sales line table and in sales header table? No other logic to it?
I've done something simliar with Navision 4.0, NAS, and XMLPorts. XMLPorts are the way to go for this type of project and I would recommend upgrading because it will make your life easier. However, I did have to handle a text file manually (which you cannot use a dataport with the NAS) and I had to programatically parse the file and write the lines to the database. Since you are creating a sales order automatically you'll probably need to do some validation on the sales line to confirm that it's correct before you insert it (such as Items are real etc.). You might want to consider creating two new tables and inserting the records there and validate it from there into the real sales header and lines. You'll need to consume two tables for this but it might be easier to work with.
Yes, the tables are 36 and 37, but the process is complex, also because you must be sure that the information that comes with the file are still inserted in NAV (the items, the customers...).
When you create or modify some records in the standard tables you must call the Validate trigger of the fields and it's important to respect the correct sequence. In order to write a correct code, you must know how you should do it manually: if you don't know in which way an end user inserts a new sales order in the system, you cannot write a good code...
It's impossible to write you more about this in this forum.