Updating NAV data through web services
The functionality of page web services in NAV is not limited to reading data from the NAV server. Data exposed through an OData web service can be updated as well. In the following recipe, we will create a sales order using the OData web service.
Getting ready
To create a sales document in NAV, we must have access to at least two tables: sales header and sales line. Each NAV web service can expose a single object, therefore, to have access to both sales header and sales lines, we need to publish two web services. If you completed the Querying NAV OData web services with LINQ recipe, Page 42 Sales Order
, representing the Sales Header
table, is already published. Otherwise, refer to the aforementioned recipe to expose the first of the pages required in the following walk-through.
How to do it...
In this recipe, we will develop a C# application that will connect to the NAV database via a web service to create a sales order.
In addition to page 42, publish page...