47,99 €
This book is a focused tutorial on Microsoft Dynamics NAV application development to help you develop complete applications and not just application outlines.
This hands-on guide starts off by introducing the supply chain that you will be using throughout the book. You will then implement the Microsoft Dynamics NAV ERP suite and learn to set it up and customize it for various industries. You will learn how to customize Dynamics NAV to suit the different aspects of a business such as financial management, relationship management, production, jobs, trade, storage, logistics, and so on. The book will take you through these Microsoft-designed application features and show you how to customize and extend them safely. Therefore, by the end of this book, you will be able to create a structure of your own in Microsoft Dynamics NAV.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 432
Veröffentlichungsjahr: 2014
Microsoft Dynamics NAV 2013 Application Design
Second Edition
Customize and extend your vertical applications with Microsoft Dynamics NAV 2013
Marije Brummel
BIRMINGHAM - MUMBAI
Microsoft Dynamics NAV 2013 Application Design
Second Edition
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2010
Second edition: September 2014
Production reference: 3100822
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78217-036-5
www.packtpub.com
Cover image by Pratyush Mohanta ([email protected])
Credits
Author
Marije Brummel
Reviewers
Danilo Capuano
Alex Chow
Stefano Demiliani
Tony Hemy
Daniel Rimmelzwaan
Acquisition Editor
Nikhil Karkal
Content Development Editor
Poonam Jain
Technical Editor
Shashank Desai
Project Coordinator
Mary Alex
Proofreaders
Simran Bhogal
Maria Gould
Ameesha Green
Indexers
Hemangini Bari
Priya Sane
Tejal Soni
Graphics
Sheetal Aute
Ronak Dhruv
Valentina D'silva
Disha Haria
Production Coordinators
Kyle Albuquerque
Aparna Bhagat
Melwyn D'sa
Adonia Jones
Manu Joseph
Nilesh R. Mohite
Komal Ramchandani
Alwin Roy
Nitesh Thakur
Shantanu N. Zagade
Cover Work
Manu Joseph
Foreword
Most books on Microsoft Dynamics NAV are about the tooling and the platform, but this book is different. It describes the building blocks, the code, and the metadata patterns that the application is made up of. The foundation for the patterns was created many years ago when we developed the first versions of Microsoft Dynamics NAV. Since then, they have been reused over and over again by us and every developer in the partner channel through the copy-paste mechanism. However, it was not until Marije and her friends in PRS, Gary and Waldo, rediscovered the patterns and started to write books, blog, teach, and speak at conferences that they became well known. Over time, this has evolved into a larger effort in collaboration with the Microsoft Dynamics NAV developer community, which has improved the overall quality of customization projects and reduced the implementation time. This book is important because it describes the patterns that are most used and explores how to leverage them when you modify Microsoft Dynamics NAV to suit industry-specific needs. It also contains examples on how to create add-ons and other enhancements that are easily upgraded. Everything is based on Marije's extensive experience of designing Microsoft Dynamics NAV implementations over almost two decades and expresses Marije's dedication to the Microsoft Dynamics NAV product and the various passionate people in the Microsoft Dynamics NAV community.
Michael Nielsen
Director of Engineering for NAV at Microsoft
Marije Brummel is the person other Microsoft Dynamics NAV experts go to when they have a really hard problem to solve. In this book, Marije shares the knowledge she has gained over the past two decades. In my own work as a Microsoft Dynamics NAV consultant/developer and as an author (writing three texts on programming in different versions of Microsoft Dynamics NAV), I've had the opportunity to draw on Marije's expertise many times. By reading this book, you now have a chance to do the same.
I've known Marije since we met at TechEd in Boston in 2006. Marije was already an accomplished analyst and developer—an expert in Microsoft Dynamics NAV and an MVP. Marije had been invited to that conference by Microsoft to help represent Microsoft Dynamics NAV to the other attendees who were technical experts. Since then, Marije has gained considerable experience and broadened his knowledge, particularly in the areas of business application problem solving using Microsoft Dynamics NAV.
Microsoft Dynamics NAV is a very special business software product. Included in the product is a set of IDE tools designed for the development of business applications and tailored to Microsoft Dynamics NAV. This makes it easier to create enhancements to fit the needs of specific businesses. As an integrated, full-featured ERP system, Microsoft Dynamics NAV includes functionalities for accounting, order processing, inventory control, manufacturing, distribution, service management, materials planning, and asset management. This book provides you with examples on how to choose from and apply these in a variety of business situations.
Each new version of Microsoft Dynamics NAV has delivered both new application functionalities and new technical capabilities. Upcoming versions are becoming more compatible with the cloud, mobile users, and various user interface devices. Each of these new capabilities expands the types of business applications to which Microsoft Dynamics NAV can be appropriately applied. With a worldwide-installed base already of well over 1,000,000 users, we know the uses of Microsoft Dynamics NAV are only limited by how creatively we apply our knowledge. Read on, let Marije expand your knowledge, and then use your own creativity to apply Microsoft Dynamics NAV to the needs of your businesses.
David Studebaker
Co-author, Programming Microsoft Dynamics NAV 2013
About the Author
Author, programmer, consultant, project manager, presenter, evangelist, salesperson, and a trainer. Marije Brummel has worked for Partners, ISVs, End Users, Master VARs, and Microsoft across the globe in more than 25 countries.
It's next to impossible to find someone as widely and deeply experienced as Marije in the Business Central community. She has received numerous awards including the Microsoft MVP award and the NAVUG All-Star. She was chair of the Dynamics Credentialling committee and authored the official Microsoft Exam materials. She did both onsite and online readiness sessions for Microsoft when the product went through major changes, such as moving from two-tier to three-tier and the introduction of extensions.
Her biggest passion is changing the world for the better in every way possible. One of her biggest achievements was the introduction of Design Patterns into the Business Central community. She is the go-to girl when it comes to performance troubleshooting and upgrade challenges. Technologies such as the Azure stack and Web frameworks don't hold secrets in regards to Business Central.
Marije has written many books and countless blog articles and YouTube videos, which influenced almost every person and project involved with Business Central. At home, she enjoys the outdoors with her dog and tries to spend as much time as possible with her kids and family. She likes shopping and traveling.
Acknowledgments
After I wrote my first book about application design in Microsoft Dynamics NAV, a lot has happened because of the book. I co-initiated Partner-Ready Software and worked closely together with Microsoft to improve the awareness of the great way Dynamics NAV is designed. This has been an amazing journey working together with some of the best people I've met in my professional life.
One of the best results is the awareness of design patterns in the application. In a team, more than 50 patterns have been documented.
I tried my best to implement the patterns in this book. A lot of the patterns were already there in the first edition. In this book, the patterns come together as applications, which give end users a great ERP system to use every day.
Since my previous book, my son Daan was born in 2010. The other kids, Josefien, Wesley, and Saskia, got older too, and I hope that one day they will understand the books and the beauty of software architectures. I'd like to thank them and my wife, Dionel, for giving me the freedom to explore my creativity, writing down my thoughts, and travel the world to share them. Because of my job, I have the opportunity to raise my kids in a great place where they can grow up in peace and become great people. I am very thankful for that.
A lot of people have helped me in writing and publishing this book, and I would like to thank them all for their help and patience as I am aware I am not always easy to work with.
Software architecture is more than database tables and code lines. Like any architecture, every piece should be well balanced and fit together in the complete structure. Unlike buildings and infrastructure, software is a lot more abstract, and the architecture is harder to see from outside. Together with Gary Winter, Eric Wauters, and Vjeko Babic, we have created a framework of patterns and best practices on how to put software together that is easy to understand, maintain, and upgrade, which are the cornerstones in applications such as Microsoft Dynamics NAV.
Special thanks go to David and Karen Studebaker. I met them in 2006 at TechEd in Boston, USA. Their help has been invaluable in bringing structure to my business and personal life. They have a very special place in my heart.
About the Reviewers
Danilo Capuano is a software engineer with over 8 years' experience. He lives in Naples, Italy, where he earned a degree in Computer Science. He currently works as a consultant on Microsoft Dynamics NAV in an IT company where he also completed the MCTS certification. You can refer to his website at www.capuanodanilo.com and his Twitter handle is @capuanodanilo.
Alex Chow has been working with Microsoft Dynamics NAV, formerly Navision, since 1999. Over the years, Alex has conducted hundreds of implementations across multiple industries. His customers range from $2 million a year small enterprises to $500 million a year multinational corporations.
Over the course of his Dynamics NAV career, he has often been designated as the primary person responsible for the success and failure of a Dynamics NAV implementation. The fact that Alex is still in the Dynamics NAV business means that he's been pretty lucky so far. His extensive career in the Dynamics NAV business is evidence of his success rate and expertise.
With a background of implementing all the functions and modules in and outside of Microsoft Dynamics NAV, Alex has encountered and resolved the most practical to the most complex requirements and business rules. Through these experiences, he has learned that sometimes you have to be a little crazy to have a competitive edge.
Believing that sharing these experiences and knowledge would benefit the Dynamics NAV community, Alex writes about his journey at www.dynamicsnavconsultant.com. He is also the founder of AP Commerce, Inc. (www.apcommerce.com), a full service Dynamics NAV service center founded in 2005. In addition, Alex has written a book about Dynamics NAV titled Getting Started with Dynamics NAV 2013 Application Development, Packt Publishing.
Alex lives in Southern California with his beautiful wife and two lovely daughters. He considers himself as the luckiest man in the world.
Stefano Demiliani is a Microsoft Certified Solution Developer (MCSD), MCAD, MCTS on Microsoft Dynamics NAV; MCTS on SharePoint; MCTS on SQL Server; and an experienced expert on other Microsoft-related technologies.
He has a Master's degree in Computer Engineering from Politecnico di Torino.
He works as a senior project manager and solution developer for EID (http://www.eid.it), a company of the Navlab group (http://www.navlab.it) and one of the biggest Microsoft Dynamics groups in Italy. His main activity is architecting and developing enterprise solutions based on the entire stack of Microsoft technologies (Microsoft Dynamics NAV, Microsoft SharePoint, and .NET applications in general).
He has written many articles and blogs on different Microsoft-related topics, and he's frequently involved in consulting and teaching. He has worked with Packt Publishing in the past for other books related to Microsoft Dynamics NAV.
You can get more details and keep in touch with him by reaching him at http://www.demiliani.com or via Twitter, @demiliani.
Tony Hemy has been deeply rooted in Microsoft Dynamics NAV from the age of 16. He started as an enthusiastic apprentice and now, more than a decade later, is an accomplished software development manager for Encore Business Solutions. Over the years, he has architected and customized Microsoft Dynamics NAV solutions for global organizations such as Warner Brothers and Viacom, earning an outstanding reputation and a role as the technical reviewer for two books published on Dynamics NAV. Tony has also served more than 5 years as a reserve soldier with the British Army, where he expanded not only his technical skills, but also the personal skills that have attributed to his disciplined work ethic and his determination to always do things right.
Tony's hands-on development experience with Microsoft Dynamics has given him an exceptional ability to help clients define the proper requirements that enable them to achieve their objectives. He has delivered extended capabilities through every version, every module, and every feature of Dynamics NAV, building thousands of unique configurations along the way. Tony also oversees software development, where he manages and mentors a talented development team and facilitates the best practices and standards that ensure clients receive the highest quality solutions and services. Tony is well traveled, well rounded, and well liked for his personable nature and "no shortcuts" approach, whether he is writing complex code or coaching his team.
Daniel Rimmelzwaan was born and raised in the Netherlands and moved to the USA at the end of 1999 to be with his new American wife. In Holland, he worked as a Microsoft Access and VBA developer. When looking for a job as a VB developer in the USA, he was introduced to Navision by a VB recruiter and was intrigued by the simplicity of its development tools. He decided to accept the job offer as a Navision developer with the firm intention to continue looking for a real developer job.
Almost 15 years later, a couple of stints with Microsoft's partner channel, a few years as a freelancer, Daniel is still working with NAV. He currently works with KCP Dynamics Group, an international partner that provides services to customers all over the world, and he is enjoying his career more than ever.
Daniel has had the opportunity to work in a wide variety of roles such as developer, analyst, designer, team lead, project manager, consultant, and more. Although he has a versatile experience with all things related to NAV, his main focus is designing custom solutions and business analysis.
Ever since he started working with NAV, Daniel has been an active member of the online communities for NAV, such as http://mibuso.com/, http://dynamicsuser.net/, and the online forums managed by Microsoft. For his contributions to these online communities, Daniel received his first of ten consecutive Microsoft Most Valuable Professional awards in July 2005, which was just the second year that the MVP award was given out for NAV. The MVP award is given out by Microsoft to independent members of technology communities around the world and recognizes people that share their knowledge with other members of the community.
Daniel lives with his wife and two kids in Arizona in the USA.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browserFree access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
Instant updates on new Packt books
Get notified! Find out when new books are published by following @PacktEnterprise on Twitter or the Packt Enterprise Facebook page.
Table of Contents
Preface
Chapter 1: Introduction to Microsoft Dynamics NAV
Versions and history
What is this book about
Setup versus customization
The beauty of simplicity
Horizontal versus vertical solutions
Open source
Design patterns
Architectural patterns
Design patterns
Implementation patterns
APIs
Structure of this book
The Role Tailored concept
The building blocks
Tables as user interface and business logic
Dynamics NAV in throughout supply chain
Some basic design patterns
Number series
Extended text
Navigate
Setup tables
Posting groups
Pricing
Dimensions
Architectural design patterns
Master data
Journals
The general ledger
Balancing
Flow fields and flow filters
More journals and entries
Posting schema
Sub and detailed entries
Combining the journals into processes
Document structure
Document transactions
Other patterns
Relationship management
Jobs
Manufacturing
Summary
Chapter 2: A Sample Application
Fit-gap analysis
Designing a squash court application
Look, learn, and love
Drawing the table and posting schema
The project approach
Interfacing with the standard application
Design patterns
Getting started
Creating squash players
CreateVendor versus CreateCustomer
Reverse engineering
Designing a journal
Squash court master data
Chapter objects
Reservations
The journal
Reservation
Invoicing
Time calculation
Price calculation
Squash prices
Price Calc Mgt. codeunit
Inherited data
Dimensions
Master data
Journal
The posting process
Check line
Post line
Invoicing
Invoice document
Sales header
Sales line
Dialog
Posting process
Analyze the object
Making the change
Navigate
FindRecords
ShowRecords
Testing
Summary
Chapter 3: Financial Management
Chart of accounts
Posting accounts
VAT versus sales tax
The entry tables
Sub accounting
Working with general journals
Entry application
Posting groups
Dimensions
Budgeting
Creating budget entries
Accounting periods
Closing dates
Currencies
Consolidation
VAT statement
Data analysis
Account schedules
Analysis by dimensions
The setup
Customizing financial management
Sales line description to G/L Entries
Extra fields in the G/L Entries
Integrating with financial management
Creating a G/L transaction
The C/AL code
Advanced entries
Look, learn, and love
Chapter 4: Relationship Management
How companies work
Contacts
Salutation codes
Alternative addresses
Relationships with customer and vendor
Duplicates
Profiles
Automatic profiles
Interactions
Automatic interactions
Finished interactions
To-do's
Opportunities
Workflow
Sales stages
Creating an opportunity
Creating segments
Adding contacts
Refine/reduce contacts
Segment criteria
Mailing groups
Log segment
Campaigns
Pricing
Segments
Activate
Outlook integration
E-mail logging
The setup
Customizing relationship management
Salutation formula types
Support the formula
The GetSalutation function
Setup the salutation formula
Test the solution
Customer and vendor numbering
Disabling the direct creation of customers and vendors
Sharing contact information across companies
Share tables
Business relation
C/AL code modifications
Number Series
Final steps
Alternative approaches
Adding contacts to segments
Expanding report
Implementing criteria filters
Test solution
Summary
Chapter 5: Production
What is production?
Production methodologies
Raw materials
Basic production principles
Bill of materials
Material requirements planning
Garbage In Garbage Out
Master Production Schedule
Item costing
Item tracking
Quality control
Energy and waste
Association for Operations Management
Getting started
Assembling
Design patterns
The items
Item costing
Item tracking
The bill of materials
Calculating the standard cost
Creating the inventory
Adjusting cost item entries
Posting inventory cost to G/L
Check, check, and double check
Recalculating the standard unit cost
Assembly orders
Check costing (again)
Recalculating the unit cost (again)
Standard cost worksheet
Item Revaluation Journal
The result
Summarizing item costing in 10 steps
Manufacturing
The items, machines, and work centers
Capacity
Production bill of materials
Routing
Testing and low-level code
Simulation, sales orders, or inventory
Calculating MPS and MRP
Inventory profile offsetting
Atomic coding
Calculating a plan
Production order workflow
Purchase orders
Finishing production
Specialized production
Jobs
Vertical industry implementation
Fashion
Bill of materials
Shipping worksheet
Automotive
Tooling and amortization
Item tracking
Medicines
Lot numbers and expiration dates
Quality control
Food
Zero inventory
Ordering schedules
Furniture
Calculations
Inventory
Summary
Chapter 6: Trade
The process
Wholesale versus retail
Sales and purchasing
Transaction mirroring
Sales
Orders
Quote to order and blanket order to order
Creating a new sales order
Sales header
Sales lines
Sales line fields
Validation flow
VAT calculation
Invoicing
Prepayments
Combined invoicing
Credit memo and return orders
Purchasing
Resources
Drop shipments
Document releasing and approval process
Status
Releasing a document
Manual versus automatic releasing
Document approval
Deleting sales and purchase documents
Data deletion
Deletion of shipments and invoices
Inventory management
Items
Locations
Variants
Stock keeping units
Creating a SKU function
Sales pricing
Item ledger entry application
Item application C/AL routine
Requirements to apply an item ledger
Value entries
Direct cost
Value entries and general ledger entries
Transfer orders
Example
Requisition worksheets
Reordering policy
Extending the reordering policy
Virtual inventory
Warehouse management
Warehouse strategy levels
Location setup
Warehouse employees
Bin code | level 1
Example
Bin content
Receipt and shipment | level 2
Warehouse request
Limitations
Put-away and Pick | level 3
Warehouse request
Warehouse activities
Level 2 and level 3 comparison
Level 4 – receipt with Put-away worksheet
Whse.- activity register versus whse.-activity-post
Level 5 – directed put-away and pick
Zones and default bins
Bin calculation
Implementing and customizing warehouse management
Reservations
Check-avail. period calc.
Always versus optional reservation
Reservation entries
Creating a reservation
Order tracking policy
Example
Replenishment
Auto increment
Trade in vertical industries
Fashion
Sales orders
Reservations
Automotive
Vehicle information
Parts management
Pharmaceuticals/medicines
Medication card
Contribution invoicing
Food
Assortment
Fast order entry
Furniture
Variant configuration
One-off items
Summary
Chapter 7: Storage and Logistics
How to read this chapter
Chapter objects
The process
Using standard features
Defining the modules
Storage
Logistics
Invoicing
The storage application
Documents
Look, learn, and love
Drawing the design pattern
Sharing tables
Getting started
Opening balance
Products
Warehouse
Regions
Shelves
Registration worksheet
Storage documents
Receipt
Put-away
Shipment
Picks
The logistics application
Drawing the design patterns
Getting started
Shipments
Routes
Combining shipments
Route optimizer
Route follow up
Incidents
Follow up
The invoicing application
Income and expense
Invoicing
Sales Line
Codeunit Sales-Post (80)
Pricing methodology
Storage prices
Calculation
Result
Periodic invoicing
Processing the buffer
Combined invoicing
Add-on flexibility
Value-added logistics
Item tracking
Third- and fourth-party logistics
Summary
Chapter 8: Consulting
The process
Fits
Gaps
Resource groups
Item calculation
Issue registration
Getting started
How many jobs
Job Card
Job task and planning lines
Job journal
Job examples
Chapter objects
The new implementation
The infrastructure
The upgrade
The support team
Time sheets
Design pattern
Purchasing
Item costing versus work in progress
Invoicing
Calculating work in progress
WIP post to general ledger
Changing jobs
Quantity budgeting
Resource Groups
Calculations
Issue registration
Summary
Chapter 9: Interfacing
Interface types
Import and export
Manual
Data pulling
Data pushing
Event-driven versus timer-driven
Interfacing technologies
File
Automation control
DotNet interoperability
Client extensibility
Open Database Connectivity (ODBC)/ADO
Reading from Microsoft Dynamics NAV
Writing to Microsoft Dynamics NAV
Talking to other databases
SQL Server interfacing
Microsoft Message Queue
Application server
Web services
Exposing a NAV web service
Consuming a Microsoft Dynamics NAV web service
Standard application interfaces
Office integration
Word and Excel integration
Advanced Excel integration
Outlook integration
Outlook part
ExtendedDatatype property
Mail and SMTP mail codeunits
Outlook synchronization
Exchange integration
Office 365
SharePoint
Client add-ins
Interface methodologies
The scenario
The design
The mapping
The gaps
What if it does not work
The scenario
The interface type
The interface technology
Logging
The design pattern
The solution
Testing
Viewing the results
Interfacing into the future
Cloud-enabled Microsoft Dynamics NAV
Summary
Chapter 10: Application Design
Application life cycle
Design to use
Pages
Role centers
Reports
Design to Maintain
Naming
Quantity versus quality
Design to support
Second-level support
Design to upgrade
Has Microsoft changed my (referenced) object
Documentation
Split operational and financial information
Design to perform
OLTP versus OLAP
Fast transaction posting
Job Queue
Date compressing and cleanup
Locks, blocks, and deadlocks
Impact on development
Design to analyze
Report design
Version and object management
What is a version
Version numbering
Combining versions
Creating a version
Tracking object changes
Saving older versions
Development methodology
A sample approach
Fit/gap analysis
Prototyping
Development
Implementation
Maintenance and support
The project
Standard, customized, or both
Add-on products
Customizing
Total cost of ownership
The Road to Repeatability program
Roadmap to success
Summary
Installation Guide
Licensing
Installing Microsoft Dynamics NAV
Changing the license
Restarting service tier
Installing the objects
Importing a FOB file
Installing the Dynamic Link Library files
Registering NavMaps.dll
Registering VEControl.dll
Preface
In 1997, the company I worked for was looking to replace their MS-DOS-based software package. We were very fortunate in finding Navision Financials 1.1 as a software package that supported the upcoming Windows platform and was flexible enough to be implemented, supporting our demands.
Even though the standard functionality was nowhere near what we have today, the structure of the application design was simple and solid and has not changed since then.
In the years after that, more companies embraced Navision as their answer to the changing demands in the market, and many vertical solutions that still exist today started their life cycle. With the acquisition of Navision by Microsoft, the interest of new partners grew into the channel we know today.
Microsoft Dynamics NAV offers a unique development experience that can only be fully used once you understand how the standard application parts are designed.
When properly licensed, everyone can change how the application works. With this great possibility comes great responsibility as this means that we can also easily break important business logic.
This results in a unique need for a designer of applications that run inside Microsoft Dynamics NAV to know more about the application without going into deep functional details.
The balance in this book will be between learning and understanding how the standard application features of Microsoft Dynamics NAV are designed, and how to use this knowledge when designing our own solutions. The area between understanding the application functionality and technical design is very thin.
In this book, we will make both changes to the standard application and create new solutions. We will also discuss how Microsoft Dynamics NAV can work with other applications.
What this book covers
Chapter 1, Introduction to Microsoft Dynamics NAV, will introduce you to Microsoft Dynamics NAV. We will briefly talk about the history of the application and talk about the concepts. We will cover some of the basic design patterns such as Number Series and Navigation. Then we will discuss the data model principles used by Microsoft Dynamics NAV using master data, journals, and ledger entries covered by documents.
Chapter 2, A Sample Application, will implement the theory you learned in the first chapter in a sample application. The goal of this chapter is to better understand how Journals and Ledger entries work throughout the system, and how to create your own Journal application. You will learn how to reverse engineer the standard application to learn from it and apply this to your own customizations. We will integrate the application with relationship management and sales in Microsoft Dynamics NAV, and extend Navigation and Dimensions for our solution.
Chapter 3, Financial Management, will explore how the financial management part of the application can be used and how it is designed. This is the heart of Microsoft Dynamics NAV. You will learn important concepts such as VAT and TAX, posting groups, closing dates, entry application, and financial data analysis. We will make some changes in the core application, adding new information to the general ledger, and learn how to integrate financial management into our add-on solution.
Chapter 4, Relationship Management, will help you to analyze the sales data in our system and be more productive towards your customers. We will explore the unique design of this part of the application and integrate this with the sample application we created in Chapter 2, A Sample Application.
Chapter 5, Production, will show us how to set up Microsoft Dynamics NAV for production companies. These companies are at the start of the supply chain. We will discuss the assembly management and manufacturing. Item Costing and Item Tracking are the key elements when using this part of the application. We will look at the planning worksheet, and how to create production orders using Make-to-Order and Make-to-Stock policies. We will reverse engineer the Inventory Profile Offsetting codeunit and see how this leads to planning and purchase orders. At the end of this chapter, we will look at ten ways to customize production for vertical industries.
Chapter 6, Trade, will discuss the relationship between sales, inventory management, and purchasing, and how warehousing can be involved using different levels of complexity. Without sales, most companies will not survive. We will learn how reservation entries are used in the system from a technical perspective.
Chapter 7, Storage and Logistics, will design and build a solution for planning routes for shipments, a feature that is not available in Microsoft Dynamics NAV. We will design a solution that can be used by trading companies not only for their own shipments but also for storage companies. The solution is seamlessly integrated with the Dynamics NAV product. We will extend the Journal knowledge that we learned in Chapter 2, A Sample Application and Chapter 3, Financial Management, with new document structures we learned in Chapter 5, Production and Chapter 6, Trade.
Chapter 8, Consulting, will discuss how to implement the Job functionality using four example jobs, and extend jobs with an issue registration and timesheet application using resource groups and calculations. The Jobs functionality in Microsoft Dynamics NAV can be compared to an add-on solution. It was designed outside financial management and trade but is still integrated into the product.
Chapter 9, Interfacing, will discuss how to design a rock solid business-to-business interface. In the last decade, interfacing has become a crucial part of designing and implementing ERP systems. We will show you which technologies are available to use for interfacing and how these technologies are implemented in the standard product. We will discuss all the built-in interfaces with other Microsoft applications such as Office, SharePoint, BizTalk, and Exchange.
Chapter 10, Application Design, will focus on the concepts of application design and how they apply to Microsoft Dynamics NAV. We will focus on design to use, maintain, support, upgrade, perform, and analyze. This includes concepts for the user interface, version management, and the development methodology.
Appendix, Installation Guide, will cover installation procedures associated with objects of Dynamics NAV.
What do you need for this book
To successfully follow the examples in this book, you will need the following:
The Microsoft Dynamics NAV 2013 product CD to install the application.A full developer's license, which can be obtained by being registered or register as a Microsoft Dynamics NAV partner. Alternatively, most of the example code can be explored using a demo license, which can be downloaded from MSDN.Microsoft Office and SQL Server Management Studio for the interface examples in Chapter 9, Interfacing.The Appendix, Installation Guide, describes how to install these prerequisites.
Who this book is for
Basically, this book is for:
NAV consultants and developersDesigners of business applicationsApplication managers at end usersBusiness owners and influencersThis book assumes that you have a basic understanding of business management systems, application development, with a working knowledge of Microsoft Dynamics NAV or another ERP system.
Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We need to copy the CreateVendor function."
A block of code is as follows:
Currency Code - OnValidate()
IF "Currency Code" <> xRec."Currency Code" THEN
IF NOT JobLedgEntryExist THEN
CurrencyUpdatePlanningLines
ELSE
ERROR(Text000,FIELDCAPTION("Currency Code"),TABLECAPTION);
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
UpdateSquashPlayer()
WITH SquashPlayer DO BEGIN
GET(ContBusRel."No.");
xRecRef.GETTABLE(SquashPlayer);
NoSerie := "No. Series";
TRANSFERFIELDS(Cont);
"No." := ContBusRel."No.";
"No. Series" := NoSerie;
MODIFY;
RecRef.GETTABLE(SquashPlayer);
ChangeLogMgt.LogModification(RecRef,xRecRef);
END;
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "We can add functions in the Globals menu."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Where to find the screens in this book
Most of the screens in the book were created using the Windows Client with Microsoft Dynamics NAV 2013 Release 2. Wherever possible and necessary, the Role Center that was used is mentioned. Some chapters had new or modified Role Centers.
To find a screen, type the name in the search window on the upper-right corner of Role Center, as shown in the following screenshot. This will lead you there and tell where to find it in the menu.
Search window
Screenshots
All the screenshots in this book are taken from Windows client, which was introduced with Microsoft Dynamics NAV 2013 Release 2.
For most the images, the Action Pane and FactBox Pane were turned off to save space. This can be done using the Customize option on each page.
Customize option
How to read the application schemas
Most of the chapters in this book have schemas to clarify the flow of data though the system. They are specially designed for this book.
To read the schemas, follow the arrows. Wherever possible, the functional areas are grouped using boxes. Some schemas might have more starting and ending points as this is how the application is designed. Multiple master data tables are processed using normalized business logic.
Number and date punctuation
This book is written by a Dutch author, which means that all the number and date formatting is done in Dutch formats, for example 1.000,00 instead of 1,000.00 and 18-10-10 for October 18, 2010.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to [email protected], and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at [email protected] if you are having a problem with any aspect of the book, and we will do our best to address it.
Chapter 1: Introduction to Microsoft Dynamics NAV
Once upon a time; this is how fairytales often start and even though the story of Microsoft Dynamics NAV is everything but a fairytale, it sure has some magic.
With more than 100,000 installations, it is one of the most popular ERP packages in the mid-market. In this book, we will go through the magic of the Dynamics NAV application. We'll see how Dynamics NAV will give better information on how our business is doing and provide a better insight where processes can be optimized or need to be changed.
In this chapter, we'll discuss the basic principles of the Microsoft Dynamics NAV application, how it's structured, and why. After reading this chapter, you will have a better understanding of what to expect when implementing and designing for Microsoft Dynamics NAV.
Versions and history
At the time of publishing this book, Microsoft Dynamics NAV 2013R2, is the most recent version of the product. When the Windows version was first introduced in 1995, the product was called Navision Financials 1.0. The Danish software company that originally developed the product, Navision Software A/S, was not yet acquired by Microsoft and it was a revolution. It was a full Windows product and had all basic functionality that small companies needed. It is important to understand that the original version was targeted at smaller companies.
Since then, we have had many (20+) versions. All new versions contained new functionality and with it the product has become more mature and suitable for bigger companies as well. This was especially empowered with the support of the Microsoft SQL Server platform, allowing more concurrent users to work in the same application areas.
Until Version 5.0, the technology of the product did not change. The original intention of Microsoft was to release a new technology platform together with new functional changes. This turned out to be a very difficult task so they decided to split the technology into two releases. Version 5.0 contained new functionality and improvements while Version 2009, or 6.0, which is the technical release number, was a technology release.
The technical challenge was to migrate from the old C++ platform to .NET and to move from a two tier to a three tier technology. This was also the first release with a drastic change in the user interface. Microsoft Dynamics NAV 2009 contains an entirely new user interface, the Role Tailored Client, which is built new from the ground up — the existing (classic) user interface is the same with no changes. During this migration process, all application functionality was frozen although small improvements and bug fixes were made in 2009 SP1.
With Microsoft Dynamics NAV 2013, we have entered a new era where the transformation is complete. The product is converted to .NET and even supports limited use of DotNet Interoperability directly from the C/AL programming language. The classic user interface is discontinued as is the native database.
This book supports functionality from the 2013 release although most concepts relate back to the older versions.
What is this book about
The title of the book is Microsoft Dynamics NAV 2013 Application Design. What does application design mean? And what does it mean in Microsoft Dynamics NAV 2013?
Microsoft Dynamics NAV 2013 is a complete ERP package, but unlike other ERP packages, it has a design capable of providing an open structure and a development platform. The idea is to provide 80 percent of the solution out of the box and allow the other 20 percent to be designed by qualified business application developers.
The partner channel is a unique part of Microsoft Dynamics NAV. From the moment Navision was introduced, company management decided that it would only make sense to have an indirect selling model and to let the resellers (called partners) have the availability to change the product and add new functionalities.
This book is about both the 80 percent and the 20 percent. We'll see that the percentages differ per industry where it is applied. Some industries have close to a 100 percent fit while others have a need for an 80 percent development.
So there is a very thin line in this book between using the standard application and designing changes and expanding the product. Although this is not a development book, we'll dive into code and objects in almost every chapter.
Reading this chapter will be more than enough to understand the code but if you want to know more, we highly recommend reading Programming Microsoft Dynamics NAV 2013, David A. Studebaker, Christopher D. Studebaker, Packt Publishing.
This book is not a manual for Microsoft Dynamics NAV 2013. It will give you a clear idea of how the structure of the application is laid out and about its possibilities. We do not want to replace or rewrite the Microsoft documentation but rather want to provide ideas that you might not have thought about.
Setup versus customization
In Microsoft Dynamics NAV, the line between implementing and developing is very thin. Where you would perform a lot of setup in other ERP packages, you'll see that it often makes more sense in Dynamics NAV to make a change with the development tools.
The standard package is very complete in its functionality but does not support all industries. It is more a framework for partners to work with. In this book, we will explain this framework and what philosophy it is built on. Understanding this philosophy is critical to knowing how to expand the functionality.
However, expanding the functionality means customizing the application. Do end users in 2013 still want customized applications? Mostly, they will say they don't want their software customized, but in the next breath, they will say that the software should change to match their way of doing business, and that they should have to change their business to fit the software.
This is why Microsoft pushes their partners to create horizontal and vertical solutions on top of the standard product and release these solutions as products with their own versions as if they were a part of the standard applications. This way of using the partner channel is a unique concept that has proven to be very successful and make Microsoft Dynamics NAV useable in almost any industry.
Most companies, however, have such a unique way of working that they will always require more or less customized solutions. The total cost of ownership depends on the level of customizations and how these customizations are designed.
The key is in knowing when to do a setup and when to do a customization. Only a solid understanding of the application will help you determine which is correct.
After reading this book, you will know how to design your application best to have a good balance between cost of ownership and functionality.
The beauty of simplicity
As discussed earlier, the application is designed to be expanded and changed by external partners. When this partner program was created, a decision was made that partners could only do a proper job if the application was completely open for them to add and change. This philosophy is very important to understand when you first start implementing or changing Microsoft Dynamics NAV.
Partners can change all business logic in the application. They can add new fields to tables and create their own tables. The only thing they cannot do is delete fields from the tables in the base application.
As you can see, Microsoft Dynamics NAV is an extremely flexible and open product with a lot of freedom. But with freedom comes responsibilities. In Dynamics NAV, you are responsible for the housekeeping in your system.
Horizontal versus vertical solutions
Because of this open system, partners have created thousands of smaller and larger changes to the system. Some of these changes were bundled into new functional pieces and called add-ons. These add-ons are often solutions that change Dynamics NAV into a product for a specific industry rather than a generic ERP system. Other add-ons are specific features that can be used in all industries such as EDI or workflow. Microsoft calls the industry specific add-ons verticals and the generic add-ons horizontals.
Open source
Even though Dynamics NAV has an open source for their partners, it does not come fully equipped with a development environment like most developers are used to. It has a customization tool that lets you customize the application like you would customize another ERP system with settings. This customization tool is a basic tool that is nice to work with but misses some development features such as version control or IntelliSense. This makes it more difficult to keep track of your changes. We will discuss how to use Team Foundation Server for Object Versioning in Chapter 10, Application Design.
Design patterns
When customizing Microsoft Dynamics NAV, you can use proven concepts in the application. These proven concepts are called design patterns. There are three types of design patterns.
Architectural patterns
Architectural patterns are the main data processes and table structures. Examples are master data, singleton tables, documents, and posting and archiving processes.
Design patterns
Although this is the name that people use for the entire concept, design patterns are reusable elements to solve specific problems, such as number series and blocked entity.
Implementation patterns
Different development techniques are called implementation patterns. Examples are proxy, façade, temporary datasets, and hooks.
APIs
Application programming interfaces (APIs) are reusable blocks of code that generally do not change. They are as important to know to work with Dynamics NAV as .NET libraries are to work in C#. Within Microsoft Dynamics NAV, we have several building blocks that are reused but not changed. Examples are address formatting and the navigate page.
Structure of this book
This book will cover most functional elements of Dynamics NAV in a number of vertical industries. We will do this in a supply chain matrix. The specific industries we will look at are fashion, automotive, medicines, food, and furniture. For production and trade, we will look at the general process, and we will see how consultancy and distribution companies help in this process.
The following diagram shows how this book is structured:
For all these industries, we will look at what parts of the standard product can be utilized and where we need vertical solutions. We'll discuss how these vertical solutions will interface with the standard package or maybe even change the behavior of the standard product.
Two parts of the product, however, are so general in their use and usability for all industries that we'll discuss them in their own chapter. These areFinancial Management and Relationship Management.
To emphasize the strength of the vertical concept, we'll design and create a vertical solution for a distribution company.
Now, we will look at some of the basic concepts of the application.
The Role Tailored concept
With the NAV 2009 release, Microsoft marketing decided to introduce the concept of Role Tailored ERP. Until now, most ERP systems were module driven, meaning the application has an area for finance, CRM, sales, purchasing, and so on. The access to the individual modules was separated. A purchaser needs to switch to sales in order to see the sales orders.
Most people in a company have specialized tasks that the ERP system should support. In a classic ERP interface, the users would have to decide themselves the location of the parts that they need. This has changed with the introduction of the Role Tailored concept.
This screenshot shows a purchasers' Role Center. As you can see, all information for this person in the organization is in one place and usable in a workflow-like way. Also, the Sales Orders are accessible from the Main Menu window. It is completely different to the menu found in Version 5.0 or before.
However, the Role Tailored concept is not new. Dynamics NAV partners have been implementing it for many years. In the classic menu, as seen in the preceding screenshot, it was extremely easy to create new menus and most companies implemented their own menus per role. When the Microsoft Outlook style menu was introduced in Version 4.0, end users could create shortcut Menu Suites, which also quickly became role centers. You can clearly see that the Role Tailored concept is like coming home for Dynamics NAV.
In Microsoft Dynamics NAV 2013, the Windows Client is no longer referred to as the Role Tailored Client as it was in Version 2009. All available clients are Role Tailored.
The building blocks
To understand the development examples in this book, we will discuss some of the basic building blocks of Microsoft Dynamics NAV 2013.
Like all database applications, it starts with tables. They contain all the information displayed in a structured way. It is important to understand that the tables of Microsoft Dynamics NAV are not completely normalized. The tables are structured in the way the user interface works. This makes it easy for nontechnical people to understand the data model. We'll discuss the unique structure of the application in Chapter 2, A Sample Application.
Tables, however, not only contain data, but they contain business logic as well. As they are structured like the functionality in the database, tables contain simple functions like address validation and more complex functions for VAT and discount calculation.
Whenever functionality gets more complex or can be shared across the application, it is better to move them to the codeunit object. These are containers of business logic for a special purpose. Tables can also be used as a class without storing data. This allows more structured programming.
For the user interface, there are two object types: reports and pages. Reports are originally intended to be printed on paper but with the current status of technology, they are more and more used as information dashboards, combining management information with drill-through possibilities.
As the tables are structured in the way the application works, the pages are bound to one table. For people new to this concept, it sometimes takes a while to get used to this.
The Menu Suite defines the way the navigation is structured when people leave their Role Centers and go to the department pages. The Menu Suite is used for the Search window.
The last object type is an external interface object. XML ports make it possible to import and export data in and out of the system.
Query objects are introduced in Microsoft Dynamics NAV 2013 and allow developers to define SQL Server SELECT statements on the metadata level that can be used in C/AL code. It is possible to join multiple tables into one query. Query objects can also be exposed as OData web services.
For this book, the table and page objects are the most important to understand. Most of this book, however, can also be applied to older versions but then forms should be applied wherever this book addresses pages.
Tables as user interface and business logic
The table object in Microsoft Dynamics NAV is very important. Since it is not normalized, it contains a lot of information about how the database works.
For example, the Job Card (88) is built on one table, the Job (167). This table contains all the fields required for this screen.
In a traditional development environment, this screen would have a transaction GetJobData and UpdateJobData. These