Extending the application for deleting NAV sales order lines

Here we want to extend our application in order to be able to delete sales order lines.

When working with sales lines, we can use the previously published SalesOrder  Page web service (Page 42) or we can publish directly the NAV Page 46 (Sales Order Subform) as a web service.

Using the SalesOrder web service (Page 42)

You can delete a sales order and/or its sales order lines by using the SalesOrder Page web service:

    //Web Service instantiation 
    SalesOrder_Service ws = new SalesOrder_Service(); 
    ws.Url = Properties.Settings.Default.NAVWSURL; 
    ws.UseDefaultCredentials = true; 

To delete a sales order (given the order number to delete) you have first to read the sales order and then delete it ...

Get Building ERP Solutions with Microsoft Dynamics NAV now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.