Anda di halaman 1dari 12

Chapter 1: Introduction to Development I C/SIDE

CHAPTER 1: INTRODUCTION TO MICROSOFT DYNAMICS NAV DEVELOPMENT I - C/SIDE


Objectives
The objectives are: Discuss objects in Microsoft Dynamics NAV. Describe fundamental aspects of C/SIDE development, including the UI, application objects, C/SIDE concepts, and types of databases. Discuss database structure. Describes some integration tools and advanced development concepts.

Introduction
Before beginning hands-on development, it is important for developers to understand the basic architecture and objects of Microsoft Dynamics NAV 5.0. This chapter describes the seven objects used in Microsoft Dynamics NAV to create the tables, forms, reports and other elements of the application. In addition, this chapter describes the development environment, concepts behind C/SIDE objects, and the structure of the database. Finally, next steps in development are described.

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-1

C/SIDE Introduction in Microsoft Dynamics NAV 5.0

Basic Objects in Microsoft Dynamics NAV


There are seven basic objects in C/SIDE: Object Tables Description Used to describe how data is stored in the database and how it is retrieved. Understanding tables is the key to using all of the other objects in C/SIDE. Used to display data to the user in a familiar and useful way. Most forms allow the user to add records to a table, and to view and modify records. Enable users to summarize and print detailed information using the filters and sorting that they choose. Allow you to export or import table data. The dataport and report objects share an underlying architecture so you can apply what you learned about reports here. Conceptually related to a dataport; you also use these to import and export data, but in XML format. XMLports make the process of exchanging data in XML between systems more simple and streamlined. Enable developers to organize and group the code that they write. Contain the menus that are displayed in the Navigation Pane and in the Navigation Pane Designer. Each menu contains content for a specific departmental area, such as Finance or Manufacturing.

Forms

Reports

Dataports

XMLports

Codeunits MenuSuites

C/SIDE is not object-oriented but object-based. This is an important distinction. In an object-oriented language or environment, the developer can create new types of objects based on the ones already in the system. In C/SIDE, you have seven types of application objects and that is all. You can create and use Tables, Forms, Reports, Dataports, XMLports, Codeunits, and MenuSuites, but nothing else. Limiting you to using these seven objects tends to make your work faster and more efficient. The biggest benefit from this limitation is stability; it is fairly difficult to create a severe bug in C/SIDE.

1-2

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Chapter 1: Introduction to Development I C/SIDE

C/SIDE Fundamentals
A C/SIDE (Client Server Integrated Development Environment) application is composed of the seven types of application objects, as described in the previous section. Each application object is created using a specific designer. For example, tables are created with the Table Designer, forms are created with the Form Designer, and so on. The application objects you create using designers are all based on some general concepts. A fundamental knowledge of these concepts speeds up the C/SIDE application development process. This section introduces you to the C/SIDE user interface and presents the general concepts that underlie C/SIDE application objects.

The C/SIDE User Interface


The C/SIDE user interface is comprised of the following: Object Designer, which contains designers for each of the seven object types. Navigation Pane Designer, which is used for arranging MenuSuites on the Navigation Pane. Various Tools and Editors, including a Toolbox for adding controls to forms, a C/AL Editor for editing code, a Properties window, a Debugger, and other tools and editors.

When you install C/SIDE, all the icons you need to work within C/SIDE are also automatically installed. The user interface gives access to a number of tools and functions. Some parts of the user interface also provide information about the current state of the system. To... Get information about the name and path of the current database Access functions on drop-down menus Access the most commonly used functions quickly Work with the application design tools View basic status information about your system (such as the current date and your user ID) Use the... Title Bar Menu Bar Toolbar Work Area Status Bar

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-3

C/SIDE Introduction in Microsoft Dynamics NAV 5.0


Designing Application Objects
Any application designed in C/SIDE is based on the seven different types of application objects available through the Object Designer:

FIGURE 1-1: C/SIDE USER INTERFACE WITH THE TABLE DESIGNER OPEN

Tables are the fundamental objects that store the actual data. Other application objects are needed to insert, modify, delete, or show data from tables. A form is typically used to enter or retrieve data from the database and a report is used to print data. NOTE: All application objects are identified by an ID number. There are, however, restrictions about which numbers you use when creating your application objects. In the Object Designer, you select the type of application object to work on. From the Object Designer you can run an application object, start an application object designer to modify the design of an existing application object, or create a new application object.

1-4

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Chapter 1: Introduction to Development I C/SIDE


The table below lists the tools you can access by means of the Object Designer and when to use them. Use the Table Designer Form Designer Report Designer Dataport Designer XMLport Designer C/AL Editor Navigation Pane Designer When Working on Tables Forms Reports Dataports XMLports Codeunits MenuSuites

There is a specific designer for each type of application object. When creating or modifying an application, you can work on any number of application objects at the same time, and each application object is shown in its own designer. For example, if you work on three new forms at the same time, each form is displayed in its own Form Designer. The Object Designer is the only designer that cannot have more than one instance running at a time. The designers are discussed further throughout this training manual.

C/SIDE Applications
C/SIDE is specially designed for creating accounting and business management applications. Any C/SIDE application consists of the same objects as a C/SIDE database. The difference between objects in a database and objects in an application is that databases contain a collection of application objects, whereas applications are a set of application objects tied together to form a coherent whole.

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-5

C/SIDE Introduction in Microsoft Dynamics NAV 5.0


General C/SIDE Concepts
The seven application object types are based on some general concepts. Some of these concepts are restricted to one type of application object while others apply to several types. The following table summarizes how the application objects are related to these general concepts and explains what each type of application object is used for. Application Object Uses Type Table A table is used for storing the actual data. Typically a business application has a Customer table that stores information such as name, address, phone number, and contact person for each customer. A form is used to access the information contained in tables. Forms are used both when users enter new information and when they view existing information. A report is used to present data that contains summary information. For example, use a report to print a list of customers. A dataport is used to import and export information to and from other programs (a comma-separated file from a spreadsheet, for example). XMLports are also used to import and export data, but in XML format. XMLports make the process of exchanging data in XML between systems more simple and streamlined. A codeunit contains user-defined functions written in C/AL code. These functions can be used from the other objects in your application. This minimizes the size of the application because the same code can be reused. The MenuSuite object contains the menus displayed in the Navigation Pane and in the Navigation Pane Designer. Each menu contains content for a specific departmental area, for example, Finance or Manufacturing. Properties, C/AL, DataItems, RequestForm, Triggers Properties, C/AL, TagNames, TagTypes, XMLport Events C/AL, Triggers

Concepts Properties, Fields, Keys, C/AL, Triggers

Form

Properties, C/AL, Controls, Triggers

Report

Dataport

XMLport

Codeunit

MenuSuite

Menu Node, Menu Group, Menu Item

1-6

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Chapter 1: Introduction to Development I C/SIDE


The terms in the third column have the following descriptions: Properties: Properties control the appearance and behavior of application objects and all sub-objects. Properties are used to control the appearance of data, specify default values, specify colors, and define relationships. C/AL: C/AL is the language used for writing functions in C/SIDE. In the previous table, "C/AL" refers to functions written in this language. Triggers: When specific things happen to the application objects, the system automatically activates a trigger. Inside a trigger, you can add your own C/AL code if you want to modify the default behavior of the application object or extend its functionality. Keys: A key defines the order in which data is stored in your tables. Speed up searches in your tables by defining several keys to sort information in different ways. Fields: A field is the smallest unit of information in the database. A field typically stores information such as a name or a number. Controls: Controls are objects on a form or report that display data, perform actions or decorate the form. Typical examples are command buttons and text labels. Request Form: A request form is a form used in a report. Before a report is run, a request form appears to let the user specify filters and options for the report. Data Items: A data item is a building block used for defining a model of data when creating a report. By using a hierarchy of data items, you define which data to include in your report. A data item represents a table and when you run a report, the system cycles through the records in the associated table. A data item can have one or more sections. Sections: A section is a substructure of a data item. A section is where controls are placed to display information. You typically use sections defining the body, header, and footer in your report. TagName: TagNames are used to specify the name of a tag in an XML document. The name specified is inserted in the TagName field of the XMLport Designer of the element or attribute in question. TagTypes: This property is used to specify whether an XML object is an element or an attribute. Menu Node: Either a Menu Group or a Menu Item. Menu Group: A collection of Menu Nodes.

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-7

C/SIDE Introduction in Microsoft Dynamics NAV 5.0


Menu Item: The lowest level of the menu tree. It is associated with a form, report, batch job, dataport, or codeunit.

The Physical and the Logical Database


Typical database users are not concerned with where each piece of data is stored on the hard disk or what its size is; they just want to be sure that when they refer to a name, for example, the correct value is returned. This is why the C/SIDE database system provides a conceptual representation of data that does not include too many details about how the data is stored. An abstract data model is used for this conceptual representation. This data model uses logical concepts (such as objects, their properties, and their relations) that are easier to understand. Therefore, it is helpful to distinguish between the logical and the physical database. When speaking about the logical database, only be concerned with the structure of the data and the relationships between different bits of information. That is, users do not deal with how these structures and relations are implemented. The physical database deals with how the structures in the logical database and the search paths between them are implemented. In this course, the term database generally refers to the logical database unless otherwise noted. What the user sees as a coherent set of information in the C/SIDE database system can be stored in several physical disk files, but this is transparent to the user. The following figure illustrates how one logical database can be physically stored on three hard disks but still comprise a single (logical) database.

FIGURE 1-2: ILLUSTRATION OF LOGICAL VS. PHYSICAL DATABASES

The Logical Structures in Your Database


Access to the data is made possible by a well-defined logical organization composed of: Fields Records Tables Companies

1-8

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Chapter 1: Introduction to Development I C/SIDE


Fields A field is the smallest logical structure used in the C/SIDE database. A field is used to hold a single bit of information, such as a name or an amount. Any particular field can hold information of only one specific type. (The C/SIDE database system distinguishes between 17 different types of information.) Fields are assembled into a structure called a record. On its own, a field is not useful as it can hold only a limited amount of information. Having these small bits of information assembled into records results in a much more flexible "information-holder" that is also better organized because it groups fields that belong together. Records A record is a logical structure assembled from an arbitrary number of fields; it is used to store a single entry in the database. The fields in a record are used to store information about important properties of the entry. Records are organized in tables. Tables A table can be thought of as an N times M matrix. Each of the N rows describes a record and each of the M columns describes a field in the record. Tables are organized in companies. Companies A company is the largest logical structure used in a C/SIDE database. A company may be considered as a sub-database; its primary use is to separate and group large portions of data in a database. A company can contain private tables as well as tables shared with other companies.

FIGURE 1-3: RELATIONSHIP OF LOGICAL STRUCTURES TO EACH OTHER IN DATABASES

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-9

C/SIDE Introduction in Microsoft Dynamics NAV 5.0

Beyond Microsoft Dynamics NAV Development I


This course provides an introduction to development concepts and processes related to Microsoft Dynamics NAV, and is the basis for the C/SIDE introduction certification exam. To further develop these skills, and to learn about integration tools available with Microsoft Dynamics NAV, it is recommended that developers explore additional classes on developing solutions, customizing Microsoft Dynamics NAV solutions, and business intelligence options, all of which cover the following integration tools.

ODBC, OCX, Automation, and C/Front


The following integration tools enable developers to interact with data or to control other applications and/or components. ODBC Open DataBase Connectivity, or ODBC, is a standard database access method developed by Microsoft Corporation. The goal of ODBC is to make it possible to access any data from any application regardless of which database management system (DBMS) is handling the data. ODBC manages the access of data by inserting a middle layer called a database driver between an application and the DBMS. The purpose of the middle layer is to translate the application's data queries into commands that the DBMS understands. For this to work, both the application and the DBMS must be ODBC-compliant that is, the application must be capable of issuing ODBC commands and the DBMS must be capable of responding to them. OCX OLE Custom control, or OCX, is an independent program module that can be accessed by other programs in a Microsoft Windows environment. OCX controls end with an .ocx extension. OCX controls represent Microsoft's second generation of control architecture, the first being VBX controls written in Visual Basic. Both VBX and OCX controls have now been superseded by Microsoft ActiveX controls. However, ActiveX is backward compatible with OCX controls which means that ActiveX containers such as Microsoft's Internet Explorer can execute OCX components. There is a vast array of commercially available OCXs that perform a variety of tasks and developers can produce their own. They can use tools such as Microsoft Visual C++ or Visual Basic to create OCXs that can be called by Microsoft Dynamics NAV.

1-10

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Chapter 1: Introduction to Development I C/SIDE


Automation OLE Automation is the name for the ability of one program to expose any or all of its capability for another program to use. The program that provides the functionality being called is the automation server and the program that uses the functionality of the automation server is the automation controller (or client). C/SIDE supports automation servers by acting as an automation controller and using OCXs (custom controls). However, Microsoft Dynamics NAV is not an automation server. The most common use of automation within Microsoft Dynamics NAV is the controlling of Microsoft applications such as Microsoft Word, Microsoft Excel, and Microsoft Outlook. Both OCX and Automation are part of Microsoft's COM technologies. It is recommended that developers refer to the Microsoft Dynamics NAV Application Designer's guide for more information about COM. Furthermore, additional information on Microsoft's technologies can be found by searching Microsoft's Web site. Developers who plan to use existing COM objects from C/SIDE, such as controls or automation servers, do not need a complete understanding of COM. However, it is suggested that you understand how to use objects and how to access the COM object. Using the functionality provided by a COM object is no different than using any C/AL function. C/FRONT C/FRONT is an application programming interface that can be used to access a Microsoft Dynamics NAV database. C/FRONT facilitates high-level interaction with the Microsoft Dynamics NAV Server, and enables developers to manipulate any Microsoft Dynamics NAV database. The central component of C/FRONT is a library of C functions. These functions provide access to every aspect of data storage and maintenance, and enable the integration of both standard and custom applications with a Microsoft Dynamics NAV database. C/FRONT comes as a DLL for direct linkage with a program and also as an OCX that a program can use.

Conclusion
A thorough understanding of this information enables developers to streamline their development processes by learning how to develop integrations and customizations for the Microsoft Dynamics NAV system. This training material explains how to navigate within the development environment, how to create and use the basic objects, and how to implement best practices for ensuring smooth software upgrades in the future.

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

1-11

C/SIDE Introduction in Microsoft Dynamics NAV 5.0

1-12

Microsoft Official Training Materials for Microsoft Dynamics Your use of this content is subject to your current services agreement

Anda mungkin juga menyukai