Post salesorder from NAS

Navision Articles

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Not Verified) This post has 0 verified solutions | 6 Replies | 1 Follower

Not Ranked
13 Posts
175 Points
Joined: Jan 18, 2007
Last Online:
Feb 11, 2010 8:10
gmorken posted on Jul 1, 2009 11:03
How helpful was this post/question? Please rate here:

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?

All Replies

Top 75 Contributor
Male
279 Posts
3,115 Points
Joined: May 20, 2002
Last Online:
Mar 16, 2010 18:17
Location: Milano
marcoferrari replied on Jul 1, 2009 12:03
How helpful was this comment/solution? Please rate here:

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 Ferrari
Cronus.it

Not Ranked
13 Posts
175 Points
Joined: Jan 18, 2007
Last Online:
Feb 11, 2010 8:10
gmorken replied on Jul 1, 2009 12:36
How helpful was this comment/solution? Please rate here:

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. 

Top 75 Contributor
Male
279 Posts
3,115 Points
Joined: May 20, 2002
Last Online:
Mar 16, 2010 18:17
Location: Milano
Solution (Not Verified) marcoferrari replied on Jul 1, 2009 14:12
How helpful was this comment/solution? Please rate here:
Suggested by David Singleton

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).

Marco

Marco Ferrari
Cronus.it

Not Ranked
13 Posts
175 Points
Joined: Jan 18, 2007
Last Online:
Feb 11, 2010 8:10
gmorken replied on Jul 1, 2009 14:45
How helpful was this comment/solution? Please rate here:

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?

Top 500 Contributor
41 Posts
420 Points
Joined: Sep 11, 2003
Last Online:
Sep 9, 2009 23:28
Solution (Not Verified) Ian Bachus replied on Jul 2, 2009 21:46
How helpful was this comment/solution? Please rate here:
Suggested by David Singleton

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.

Top 75 Contributor
Male
279 Posts
3,115 Points
Joined: May 20, 2002
Last Online:
Mar 16, 2010 18:17
Location: Milano
marcoferrari replied on Jul 3, 2009 14:51
How helpful was this comment/solution? Please rate here:

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.

Marco

Marco Ferrari
Cronus.it

Page 1 of 1 (7 items) | Get this RSS feed | Bookmark and Share