Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building ERP Solutions with Microsoft Dynamics NAV

You're reading from   Building ERP Solutions with Microsoft Dynamics NAV Solve business scenarios using NAV

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781787123083
Length 392 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Stefano Demiliani Stefano Demiliani
Author Profile Icon Stefano Demiliani
Stefano Demiliani
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introduction to Microsoft Dynamics NAV Architectures FREE CHAPTER 2. Configuring Microsoft Dynamics NAV Web Services 3. Creating an Application Using NAV Web Services 4. Using NAV Web Services with Microsoft Power BI 5. Integrating NAV Web Services and External Applications 6. Extending NAV Pages with Control Add-ins 7. Programming Universal Windows Apps with NAV and Devices 8. Exploring Microsoft Azure and its Services 9. Working with NAV and Azure App Service 10. Implementing a Message-Based Architecture with Azure Service Bus and NAV

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 via its Key field. The steps in the code are these:

    //Read the Sales Order given its Order Number 
    SalesOrder so = ws.Read(SalesOrderNo); 
 
    //delete the Sales Order 
    ws.Delete...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime