RS First Dynamics NAV Blog

...from NAV 3.60 to NAV 2013
Archivio Posts
Anno 2015

Anno 2014

Anno 2013

Anno 2012

Anno 2011

Anno 2010

Anno 2009

Anno 2008

Anno 2007

NAV Web Services Connectivity Samples

NAV Web Services Connectivity Samples
(Many Samples reposted from original Freddy Blog posts) blog posts available "AS TODAY" about Web Services Connectivy & Integration (my opinion!)

Web Services Infrastructure and how to Create an Internal Proxy

Connecting to NAV Web Services from C# using Web Reference

Connecting to NAV Web Services from Visual Basic .net using Web Reference

Connecting to NAV Web Services from Java

Connecting to NAV Web Services from the Cloud–Part 1 out of 5

Connecting to NAV Web Services from Windows Mobile 6.5

Extending page Web Services (and creating a Sales Order again)


About the last above... Great post !!!  

Extending page Web Services, "Creating a Sales Order through Web Services"

Creating the Order header

Order_Service service = new Order_Service();
service.UseDefaultCredentials = true;

Order order = new Order();
service.Create(ref order);

After this we have a Order Number and an empty order – exactly like leaving the order No. field on the Sales Order Page.
Fill out the Order Header and create the Order lines
In this sample I will just fill out the Sell_to_Customer_No – a number of the other Order Header fields will be auto-updated when updating the order


order.Sell_to_Customer_No = "10000";

Then we need to create the Order lines

in this sample I will create 5. BTW – It is NOT trivial to add an order line after the fact, so I suggest you add the needed number of lines in one go:

order.SalesLines = new Sales_Order_Line[5];
for (int i = 0; i < 5; i++)
    order.SalesLines[i] = new Sales_Order_Line();
service.Update(ref order); 

Fill out the Order lines
In this sample, I will just create 5 lines with green ROME guest chairs.

for (int i = 0; i < 5; i++)
    order.SalesLines[i].Type = OrderPageRef.Type.Item;
    order.SalesLines[i].No = "1960-S";
    order.SalesLines[i].Quantity = 1;
service.Update(ref order);

That’s it – the order is created and you can find it in the Client.
And at last… – Post the order

Having created the order, now it is time to post the order



Great Posts about NAV Web Services by "Freddy Blog"and Great Blog!

by Freddy Kristiansen
PM Architect, Microsoft Dynamics NAV

Categoria: Dynamics NAV 2013
venerdì, 01 ago 2014 Ore. 11.58

Messaggi collegati

  • Views Home Page: 455.215
  • Views Posts: 869.389
  • Views Gallerie: 0
  • n° Posts: 343
  • n° Commenti: 0
Copyright © 2002-2007 - Blogs 2.0 | Home Page Blogs
ASP.NET 2.0 Windows 2003