- 1. Chapter 13: Integration OptionsCHAPTER 13: INTEGRATION
OPTIONSObjectivesThe objectives are: Describe the concepts of
Microsoft Dynamics NAV Web Services. Create a codeunit Web service,
expose a page and a codeunit Webservice and consume them from an
external application. Describe the concepts of Microsoft Dynamics
NAV ODBC, itsrequirements, installation and limitations. Use
Microsoft Dynamics NAV ODBC. Describe the concepts of C/FRONT, its
requirements, installationand limitations. Describe the concepts of
OCX, its installation, registration andlimitations. Use OCX
controls. Describe the concepts of Automation, its requirements,
installationand limitations. Create a report with
Automation.IntroductionMicrosoft Dynamics NAV 2009 offers some
integration possibilities by usingthe following technologies: Web
service Microsoft Dynamics NAV ODBC C/FRONT OCX AutomationThese
integration options have their own pros and cons, and sometimes
choosingthe best technology, depends on a case by case
basis.Microsoft Dynamics NAV 2009 offers Web services support as a
new method ofinteracting programmatically with the system. It can
be accessed over a networkand enables execution on a remote system.
It stands as a widely-used, industrystandard, which means it is
used by other systems and products across theindustry. Microsoft
Official Training Materials for Microsoft Dynamics 13-1Your use of
this content is subject to your current services agreement
2. C/SIDE Introduction in Microsoft Dynamics NAV 2009Web
ServicesWeb services are a standardized way for independent
software systems tocommunicate with one another over standard
Internet protocols. Web servicesarchitecture is designed for
dynamic program-to-program interaction.Many kinds of distributed
systems can be implemented in Web servicesarchitecture. Examples of
distributed systems include synchronous andasynchronous messaging
systems, distributed computational clusters, mobile-networked
systems, grid systems, and peer-to-peer environments.The broad
spectrum of requirements for program-to-program interactions
meansthat the protocols that are used by Web services are more
flexible than Webprotocols. However, just as the World Wide Web,
Web services also rely on afew specific protocols, such as SOAP
.Microsoft Dynamics NAV 2009 supports Web services, which makes it
easy tointegrate Microsoft Dynamics NAV with other systems. This is
possible with theintroduction of Microsoft Dynamics NAV Server.Web
services are designed to facilitate the highly dynamic data
interchange thatis required in business transactions. Web services,
as standardized integrationtechnologies, bring value to businesses
by breaking down data silos that arecreated by proprietary
integration options. These proprietary integrationtechnologies make
it difficult to obtain information in and out of the
differentsystems.Web services are described by using
machine-readable metadata, which providea robust development and
operational environment. Web service metadata servesseveral
purposes. The metadata is used to describe the message
interchangeformats that a Web service supports, and the valid
message exchange patterns ofa service. Metadata is also used to
describe the capabilities and requirements of aservice.Web Services
Description Language (WSDL), which is an XML-based languagefor
defining Web services, is used to express the interchange formats
andmessage exchange patterns of the Web servicesMost major software
development environments, such as Microsoft VisualStudio 2008, can
be used to build applications that use Web services.Moreover,
because Web services are XML based, Web services can be builtacross
platforms and programming languages.ArchitectureThe Web service
integration with Microsoft Dynamics NAV is facilitatedthrough Web
service enabled codeunits and pages. External systems read andwrite
data on pages and call codeunits as defined by the common Web
serviceprotocols, with correct authentication and authorization.
The Web servicecapabilities in Microsoft Dynamics NAV help
customers reap the benefits of aservice-oriented architecture
(SOA).13-2 Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 3. Chapter 13: Integration OptionsMicrosoft
Dynamics NAV Web services are useful to customers and partnerswho
want to use business logic or use a standard interface to access
data fromoutside Microsoft Dynamics NAV.FIGURE 13.1 MICROSOFT
DYNAMICS NAV WEB SERVICESARCHITECTUREThere are several simple types
of Web services that can be published byMicrosoft Dynamics NAV. The
types of Web services correspond to the degreeof complexity
required in the Web service interface. All Web services can runC/AL
code and validation triggers.There are several types of Web service
in Microsoft Dynamics NAV 2009: The simplest Web service type is
developed by using the pageobject. By using the page object,
Microsoft Dynamics NAVconstructs a default Web service that has a
fixed set of methods.Generally, it corresponds to general data
access, such as get and setindividual values or retrieve and update
lists of values. Another Web service type involves including
codeunits and thefunctions from those codeunits in the Web service.
The last type of Web service includes the ability to pass
complexdata types by using an XMLport object as a parameter in a
codeunitfunction. Microsoft Official Training Materials for
Microsoft Dynamics 13-3Your use of this content is subject to your
current services agreement 4. C/SIDE Introduction in Microsoft
Dynamics NAV 2009How Microsoft Dynamics NAV integrates Web services
saves the complexity ofmanually setting up Web service frameworks,
such as managing the WSDLdescriptions. To publish any type of
Microsoft Dynamics NAV Web service(page or codeunit), add it to the
Web Service table.Microsoft Dynamics NAV Web Services SupportPages
and codeunits that are added to the Web Service table in
MicrosoftDynamics NAV are immediately published and available for
Web servicerequests over the network.Consumers of these Web
services, which are systems integrating with MicrosoftDynamics NAV,
only have to know the network name (or address) of thecomputer that
is running Microsoft Dynamics NAV Server and the names givento the
individual pages and codeunits.For example, with the following
configurations: Computer name that runs Microsoft Dynamics NAV
Service:NAV_Server1 Web service port: 7047 Microsoft Dynamics NAV
Server instance: DynamicsNAV Company Name: CRONUS International
Ltd. The published page Web service: MyCustomerThen the MyCustomer
Web service is available at the following
URL:http://Nav_Server1:7047/DynamicsNAV/WS/CRONUS_International_Ltd/Page/MyCustomer(http://nav_server1:7047/DynamicsNAV/WS/CRONUS_International_Ltd/Page/MyCustomer)Microsoft
Dynamics NAV manages Web service requests exactly like it
handlesrequests from end-users. User rights authorization and
validation, input datavalidation, business logic invocation, and
concurrency control are all managed inthe same manner as requests
from a Microsoft Dynamics NAV client.This guarantees that the
integrity of the Microsoft Dynamics NAV data is notcompromised by
using Web services. It also means that code that validates dataor
invokes business logic for systems that use the Web services that
are providedby Microsoft Dynamics NAV does not have to be
replicated.When writing code for Web services, avoid using any
end-user confirmationdialog boxes or message boxes. The code for
Web services cannot interact withthe client that called the code.
It cannot respond to a dialog box or any otherclient interaction
requests. Running code with client interaction causes anexception
to be thrown. The exception can be caught and handled, but the
Webservice task will not be completed.13-4 Microsoft Official
Training Materials for Microsoft Dynamics Your use of this content
is subject to your current services agreement 5. Chapter 13:
Integration OptionsThe GUIALLOWED function is a function which is
used to check whether theC/AL code is allowed to show any
information on the screen. When the code isrun from Web services,
GUIALLOWED always returns FALSE. This is the samewith when the code
is run in Microsoft Dynamics NAV Application
Server.OpportunitiesIntegration with other systems and
communicating with different entities outsideMicrosoft Dynamics NAV
is always a challenge in any implementationscenarios.In most cases,
customers have different systems that are running together and
notonly Microsoft Dynamics NAV. Not only that, they may have to
exchange datawith entities outside their organization, which may
use a different system or evena different platform and operating
systems.AdvantagesWeb services support in Microsoft Dynamics NAV
offers great value andbenefits over its predecessors, these are as
follows: Standard integration method, which takes advantage of
developerskill sets. This in turn increases development speed and
reduces thecost of implementation. Increase return on Microsoft
Dynamics NAV investment with theintegration of data and business
logic. Codes have to be written onetime and do not have to be
redeveloped because the same codes arerun whenever using Web
services or using Microsoft DynamicsNAV Client. Consistent
integration point, which reduces management overhead,because of the
same security, validation and business logic as usingWeb services
and Microsoft Dynamics NAV Client. It also benefits from all other
advantages of Web services as anindustry standard.Suitable
CandidatesWeb services are suited for communication across
platforms and programminglanguage. With Microsoft Dynamics NAV
2009, it is easy to integrate with othersystems and benefit from
the flexibility that Web services offer.The following are
candidates for Web services: Solutions that have to execute
business logic or read data fromMicrosoft Dynamics NAV. Microsoft
Official Training Materials for Microsoft Dynamics 13-5Your use of
this content is subject to your current services agreement 6.
C/SIDE Introduction in Microsoft Dynamics NAV 2009 Solutions that
write data to Microsoft Dynamics NAV and use thesystem to validate
the data by using the existing business logic. Solutions that
extend Microsoft Dynamics NAV with additionalinformation such as
customer information, exchange rates, orproduct information and
have the extension that can be accessedfrom other systems.The
following are examples of several scenarios that are suited to Web
servicesimplementation: When a new order is created in the system,
a Web servicecommunicates with the shipping companies directly to
ensuretransportation of the order items, checking prices and
availability. Integration with exchange rates, ensuring that the
system iscontinuously updated with the latest exchange rates, which
providesprecise calculations of data. Integration with a Web
service that retrieves the latest addressinformation when new
customers are added to the system to ensureaccuracy in data.
Integration with production planning, CRM, data warehouses,
otherERP systems, specialized budgeting, planning or reporting
systems,mobile solutions and many more.Demonstration: Create,
Expose and Consume Web ServicesThe following demonstration shows
how to: Create a simple codeunit. Register the codeunit Web service
and a page Web service andpublish them. Create console applications
and consume these two Web services.Create a Codeunit Web ServiceThe
following steps show how to create a simple codeunit, with a
function tocapitalize lowercase input string.In Microsoft Dynamics
NAV Classic client: 1.Click Tools, Object Designer. The Object
Designer opens. 2.Click the Codeunit button to open the Codeunit
list. 3.Click New. The C/AL Editor opens. 4.Click View, C/AL
Globals. The C/AL Global window opens. 5.Click the Functions tab,
and type the following:o Name: Capitalize 6. Click the Locals
button. The C/AL Locals window opens.13-6 Microsoft Official
Training Materials for Microsoft Dynamics Your use of this content
is subject to your current services agreement 7. Chapter 13:
Integration Options 7. In the Parameters tab, type the following:o
Name: InputStringo DataType: Texto Length: 250 8. Click the Return
Value tab, and type the following:o Name: OutputStringo ReturnType:
Texto Length: 250 9. Close the C/AL Locals window and then close
the C/AL Globals window. 10. In the Capitalize function, type the
following:OutputString := UPPERCASE(InputString); 11. Save the
codeunit by clicking File, Save As. The Save As dialog box opens.
12. Type 90001 in the ID and MyCodeunit in the Name and then click
OK.FIGURE 13.2 THE CODEUNIT 13. Close the C/AL Editor.Expose the
Web ServicesAfter the codeunit is created and saved, register it in
the Web Services form andselect the Published check box. The
following steps show how to register Webservices:In the Object
Designer: 1. Click the Form button to open the Form list. Microsoft
Official Training Materials for Microsoft Dynamics 13-7Your use of
this content is subject to your current services agreement 8.
C/SIDE Introduction in Microsoft Dynamics NAV 2009 2. Select form
810, Web Services and then click Run. The WebServices form opens.
3. Type the following: Object Type Object ID Service Name
Codeunit90001 DemoCU Page21CustomerThe first line registers the
codeunit Web service that is created in the previoussteps. The
second line registers a page Web service, in this case the
Customerpage. 4. Select the Published check box on both lines to
publish the Webservices.FIGURE 13.3 THE WEB SERVICES FORMWhen the
Web service is marked as published in the Web Services form, it
isimmediately available for requests over the network. 5. Close the
Web Services form.Check the WSDLBefore continuing, it is
recommended to check that the Web services thatpreviously published
are available. Also, ensure that the Microsoft DynamicsNAV Business
Web Services is running. The following steps show how tobrowse to
the WSDL document to ensure that the Web services are available. 1.
Start Internet Explorer. 2. In the Address bar, type the
following:http://localhost:7047/DynamicsNAV/WS/CRONUS_International_Ltd/ServicesNOTE:
This address is based on the name of the computer that is running
theMicrosoft Dynamics NAV Service and the company that is used. The
company13-8 Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 9. Chapter 13: Integration Optionsname is
case-sensitive. In this case, localhost is used instead of the
computername. 3. The page lists the Web services registered and
published in theExpose the Web Services section.FIGURE 13.4 THE WEB
SERVICES LISTED IN INTERNET EXPLORER 4. Close Internet
Explorer.Create a Console Application to Consume the CodeunitWeb
ServiceThe codeunit Web service is available. The following steps
show how to create asimple console application in Visual Studio to
consume the codeunit Webservice. These steps start with creating a
new project in Visual Studio and thenadding a Web Reference for the
Web services published from MicrosoftDynamics NAV. 1. Open Visual
Studio. 2. Click File, New, and then click Project. The New Project
window opens. 3. Expand the Visual C# node, and select Console
Application. 4. Type the following:o Name: UseDemoCU 5. Click OK.
The UseDemoCU project initiates with default files
andreferences.Add Codeunit Web Service as a Web ReferenceThe next
step is to add the published Web service as a Web reference into
theproject. Microsoft Official Training Materials for Microsoft
Dynamics 13-9Your use of this content is subject to your current
services agreement 10. C/SIDE Introduction in Microsoft Dynamics
NAV 2009In Visual Studio: 1. In the Solution Explorer, right-click
the References node in theproject, and then click Add Service
Reference. The Add ServiceReference window opens. 2. Click
Advanced. The Service Reference Settings window opens. 3. Click Add
Web Reference. The Add Web Reference windowopens. 4. Type the
following in the URL
bar:http://localhost:7047/DynamicsNAV/WS/CRONUS_International_Ltd/ServicesNOTE:
This address is the same as the address that is used when checking
theWSDL by using Internet Explorer. 5. Click GO. The DemoCU service
is displayed together with otherservices that are available.FIGURE
13.5 THE ADD WEB REFERENCE WINDOW 6. Click View Service for the
DemoCU service and then click AddReference. The DemoCU service is
added as a Web Reference inthe project.13-10Microsoft Official
Training Materials for Microsoft Dynamics Your use of this content
is subject to your current services agreement 11. Chapter 13:
Integration OptionsType the CodeThe following steps show how to
create a code to consume the codeunit Webservice.In Visual Studio:
1. On the Program.cs tab, type the following:using System; using
System.Collections.Generic; using System.Text;namespace UseDemoCU {
using localhost; // using the web reference class Program{static
void Main(string[] args){// Create a new instance of the
service.DemoCU ws = new DemoCU();// Use default credentials for
authenticating // against Microsoft Dynamics NAV.
ws.UseDefaultCredentials = true; ws.Url
="http://localhost:7047/DynamicsNAV/WS/CRONUS_International_Ltd/Codeunit/DemoCU";//
Declare variables to work with. string InputString =""; string
OutputString ="";Console.WriteLine("Input lowercase sentence,end by
[ENTER]"); InputString = Console.ReadLine();// Call the Microsoft
Dynamics NAV codeunit Webservice.try{ OutputString =
ws.Capitalize(InputString); } catch (Exception e) {
Console.WriteLine(e.Message.ToString()); } // Write output to the
screen. Console.WriteLine("Result: {0}",OutputString); Microsoft
Official Training Materials for Microsoft Dynamics 13-11Your use of
this content is subject to your current services agreement 12.
C/SIDE Introduction in Microsoft Dynamics NAV 2009// Keep the
console window up until you pressENTER.Console.ReadLine();} } } 2.
Click File, Save All to save all the changes in the project.FIGURE
13.6 THE CODE IN VISUAL STUDIOConsume the Codeunit Web ServiceThe
following steps show how to test the console application and
consume thecodeunit Web service:In Visual Studio: 1. Click Debug,
Start Debugging, or press F5 to run the application in debug mode.
The console window opens. 2. Type the following:o this is a
lowercase sentence13-12Microsoft Official Training Materials for
Microsoft Dynamics Your use of this content is subject to your
current services agreement 13. Chapter 13: Integration Options 3.
Press ENTER. Now, the console application looks like
thefollowing:FIGURE 13.7 THE CONSOLE APPLICATION RESULTThe input
string this is a lowercase sentence is capitalized by using the
codeunitWeb service that is running on Microsoft Dynamics NAV
Service. The result inthe output string is THIS IS A LOWERCASE
SENTENCE. 4. Press ENTER to close the console window.Create a
Console Application to Consume the Page WebServiceIn the Expose the
Web Services section, two Web services are exposed andpublished.
The previous sections show how to create a console application
toconsume the first Web service, which is the codeunit Web service.
The nextsection shows how to create a console application to
consume the second Webservice, which is the page Web service.In
Visual Studio: 1. Click File, New, and then click Project. The New
Project window opens. 2. Expand the Visual C# node, and select
Console Application. 3. Type the following:o Name: UseDemoPage 4.
Click OK. The UseDemoPage project initiates with default files
andreferences. Microsoft Official Training Materials for Microsoft
Dynamics 13-13Your use of this content is subject to your current
services agreement 14. C/SIDE Introduction in Microsoft Dynamics
NAV 2009Add Page Web Service as a Web ReferenceThe next step is to
add the published Web service as a Web reference into theproject.In
Visual Studio: 1. Repeat Steps 1 to 5 in the Add Codeunit Web
Service as a WebReference section. 2. Instead of using the DemoCU
service, click View Service for theCustomer service and then click
Add Reference.FIGURE 13.8 THE CUSTOMER WEB SERVICE DESCRIPTIONType
the CodeThe following steps show how to create a code to consume
the codeunit Webservice.13-14Microsoft Official Training Materials
for Microsoft Dynamics Your use of this content is subject to your
current services agreement 15. Chapter 13: Integration OptionsIn
Visual Studio: 1. On the Program.cs tab, type the following:using
System; using System.Collections.Generic; using
System.Text;namespace UseDemoPage { // import newly generated Web
service proxy using localhost;class Program { static void
Main(string[] args) { //create instance of service and
settingcredentials Customer_Service service =
newCustomer_Service(); service.UseDefaultCredentials = true;
service.Url="http://localhost:7047/DynamicsNAV/WS/CRONUS_International_Ltd/Page/Customer";//create
instance of customerCustomer cust = new Customer();cust.Name
="Customer New";//insert customer service.Create(ref cust);
PrintCustomer(cust); Msg("The program inserted a new customer,press
[ENTER] to continue"); Console.ReadLine();//create filter for
searching for customers List filter = newList(); Customer_Filter
nameFilter = newCustomer_Filter(); nameFilter.Field =
Customer_Fields.Name; nameFilter.Criteria ="C*";
filter.Add(nameFilter);Msg("List before modification");
PrintCustomerList(service, filter); Console.ReadLine(); Microsoft
Official Training Materials for Microsoft Dynamics 13-15Your use of
this content is subject to your current services agreement 16.
C/SIDE Introduction in Microsoft Dynamics NAV 2009//modify customer
cust.Name = cust.Name + " and Modified"; service.Update(ref cust);
PrintCustomer(cust); Msg("The program modified the new
customername, press [ENTER] to continue");
Console.ReadLine();Msg("List after modification");
PrintCustomerList(service, filter); Console.ReadLine();//delete
customer service.Delete(cust.Key);Msg("List after deletion");
PrintCustomerList(service, filter); Console.ReadLine();Msg("Press
[ENTER] to exit program!"); Console.ReadLine();}static void
PrintCustomerList(Customer_Serviceservice, List filter) {
Msg("Printing Customer List");//conduct the actual search
Customer[] list =service.ReadMultiple(filter.ToArray(), null, 100);
foreach (Customer c in list) { PrintCustomer(c); } Msg("End of
List, press [ENTER] to continue"); }static void
PrintCustomer(Customer c) { Console.WriteLine("No: {0} Name: {1}",
c.No,c.Name); } static void Msg(string
msg){Console.WriteLine(msg);} } }13-16Microsoft Official Training
Materials for Microsoft Dynamics Your use of this content is
subject to your current services agreement 17. Chapter 13:
Integration Options 2. Click File, Save All to save all the changes
in the project.FIGURE 13.9 THE CODE IN VISUAL STUDIOConsume the
Page Web ServiceThe following steps show how to test the console
application and consume thepage Web service:In Visual Studio: 1.
Click Debug, Start Debugging, or press F5 to run the applicationin
debug mode. The console window opens. The application inserts a new
customer named Customer New with the default Customer No. 2. Press
ENTER to continue. The application prints a list of customers,
which name starts with the letter C. 3. Press ENTER to continue.
The application modifies the new customer name to Customer New and
Modified. 4. Press ENTER to continue. Microsoft Official Training
Materials for Microsoft Dynamics 13-17Your use of this content is
subject to your current services agreement 18. C/SIDE Introduction
in Microsoft Dynamics NAV 2009 The application prints a customer
list, which name starts with the letter C, after modification. 5.
Press ENTER to continue. The application deletes the new customer
and prints a customer list, which name starts with the letter C,
after deletion.FIGURE 13.10 THE CONSOLE APPLICATION RESULT 6. Press
ENTER to close the console window.ODBCMicrosoft Dynamics NAV ODBC
is Microsoft Dynamics NAVs implementationof Open Database
Connectivity (ODBC). Microsoft Dynamics NAV ODBC letsdevelopers
transfer data between Microsoft Dynamics NAV databases and
anyprogram that supports ODBC. Applications that support ODBC can
communicatewith Microsoft Dynamics NAV. This means, applications
such as a spreadsheetor word processor can retrieve data by
communicating with Microsoft DynamicsNAV through the Microsoft
Dynamics NAV ODBC driver.The Microsoft Dynamics NAV ODBC driver
operates in the MicrosoftWindows platforms. In these environments,
it can function either as a stand-alone or as a client in a
client/server configuration. Microsoft Dynamics NAVclient is not
needed to use the Microsoft Dynamics NAV ODBC driver.The main
purpose for using ODBC with Microsoft Dynamics NAV is
integrationwith other applications. By using ODBC, users can use
applications such as aword processor to create mail merge documents
or a spreadsheet application topull account information and create
graphs based on that information.13-18Microsoft Official Training
Materials for Microsoft Dynamics Your use of this content is
subject to your current services agreement 19. Chapter 13:
Integration OptionsArchitectureThe Microsoft Dynamics NAV ODBC has
four components: Application - Performs processing and calls ODBC
functions tosubmit Microsoft SQL statements and retrieve results.
Driver Manager - Loads and unloads drivers on behalf of
anapplication. Processes ODBC function calls or passes them to
adriver. Driver - Processes ODBC function calls, submits SQL
requests to aspecific data source, and returns results to the
application. Ifnecessary, the driver modifies an applications
request so that therequest conforms to syntax that is supported by
the associatedDBMS. Data source - Consists of the data that the
user wants to access andits associated operating system, DBMS, and
network platform (ifany) that is used to access the DBMS.The
following illustration shows the relationship between these four
components.FIGURE 13.11 MICROSOFT DYNAMICS NAV ODBC
ARCHITECTUREThere can be multiple drivers and data sources which
allow the application tosimultaneously access data from more than
one data source. The ODBC API isused in two places: Between the
application and the Driver Manager. Between the Driver Manager and
each driver.The interface between the Driver Manager and the
drivers is sometimes referredto as the service provider interface,
or SPI. For ODBC, the application-programming interface (API) and
the service provider interface (SPI) are thesame; that is, the
Driver Manager and each driver have the same interface to thesame
functions. Microsoft Official Training Materials for Microsoft
Dynamics 13-19Your use of this content is subject to your current
services agreement 20. C/SIDE Introduction in Microsoft Dynamics
NAV 2009RequirementsThere are several requirements to use the
Microsoft Dynamics NAV ODBCdriver, they are as follows: License for
Microsoft Dynamics NAV ODBC granule. Users are able to connect to
the Microsoft Dynamics NAV database either through a server
connection (by using Microsoft Dynamics NAV database server) or
through a local connection (the database is located in the client
computer). Users have permission to access the database. For
example, if a user does not have read permission for specific table
related data, they cannot read that table from either Microsoft
Dynamics NAV client or from Microsoft Dynamics NAV ODBC. Also, ODBC
users must have permission for System 9130, C/ODBC. There are
enough sessions for the users. Just as accessing the Microsoft
Dynamics NAV database by using a client, accessing the database by
using ODBC also requires a session.Furthermore, if a local
connection is used, only one connection to the databasefile can
exist at any time. Also, the local license file (fin.flf) that is
located in theclient folder must contain the Microsoft Dynamics NAV
ODBC granule.13-20Microsoft Official Training Materials for
Microsoft Dynamics Your use of this content is subject to your
current services agreement 21. Chapter 13: Integration
OptionsInstallationBy default, the Microsoft Dynamics NAV ODBC
driver is not installed wheninstalling Microsoft Dynamics NAV 2009.
The following figure shows theoption to install the Microsoft
Dynamics NAV ODBC.FIGURE 13.12 INSTALL MICROSOFT DYNAMICS NAV
ODBCLimitationsThere are several limitations when working with
Microsoft Dynamics NAVODBC, they are as follows: Data that is
entered through ODBC is not validated. It is important toensure the
data entered meets the criteria of the data type for thatfield.
Entries made by ODBC do not fire triggers, therefore any fields
thatmight get automatically filled in when entering data by using
theMicrosoft Dynamics NAV client, has to be manually populated. The
ODBC driver does not support outer joins. The ODBC driver does not
work with SQL server. Use the MicrosoftSQL ODBC driver instead.
Flow fields are not calculated, because ofthe way they are stored
on the SQL server. Microsoft Official Training Materials for
Microsoft Dynamics 13-21Your use of this content is subject to your
current services agreement 22. C/SIDE Introduction in Microsoft
Dynamics NAV 2009 Microsoft Access supports zero-length strings.
MicrosoftDynamics NAV ODBC does not convert the zero-length string
to avalue that can be used by the Microsoft Dynamics NAV
database.Therefore, the zero-length string is interpreted as a NULL
value andthe error message is returned. The Microsoft Dynamics NAV
ODBC driver does not supportparameter fields which Microsoft Access
uses when external tablesare linked.Demonstration: Use Microsoft
Dynamics NAV ODBCThe following demonstration shows how to set a
data source and use it withMicrosoft Excel and Microsoft Access to
read data from and write data toMicrosoft Dynamics NAV.Set a Data
SourceThe following steps show how to create a DSN. 1. Go to
Control Panel and click the Administrative Tools. 2. Click Data
Sources (ODBC).The ODBC Data Source Administratorwindow opens. 3.
Click the System DSN tab and then click Add.NOTE: User DSN is
available for the current user and System DSN is availablefor all
users on the current machine13-22Microsoft Official Training
Materials for Microsoft Dynamics Your use of this content is
subject to your current services agreement 23. Chapter 13:
Integration Options 4. Select Microsoft Dynamics NAV Driver and
then click Finish. TheDynamics NAV ODBC Setup window opens. 5.
Enter the necessary information and then click OK to
completecreating the DSN. FIGURE 13.13 THE DYNAMICS NAV ODBC SETUP
WINDOWRead Data from Microsoft Dynamics NAVThe following steps show
how to use the DSN created previously to return datafrom Microsoft
Dynamics NAV to Microsoft Excel. 1. Start Microsoft Excel with a
new workbook. 2. Open the Data Connection Wizard, select ODBC DSN
and thenclick Next. 3. Select Dynamics NAV ODBC Sample and then
click Next. 4. Select Cust_ Ledger Entry table and then click Next.
5. Click Finish. The Import Data window opens. Here developerscan
click Properties to open the Connection Properties windowwhere they
can customize the connection such as edit the queriesand so on.
Microsoft Official Training Materials for Microsoft Dynamics
13-23Your use of this content is subject to your current services
agreement 24. C/SIDE Introduction in Microsoft Dynamics NAV 2009 6.
Click OK. The records from the Cust. Ledger Entry table
aredisplayed in the Microsoft Excel worksheet.FIGURE 13.14 THE
RESULT IN MICROSOFT EXCELWrite Data to Microsoft Dynamics NAVThe
following steps show how to use the DSN created previously to
useMicrosoft Access to write data to Microsoft Dynamics NAV. 1.
Start Microsoft Access with a new blank database. 2. Create a
linked table by using the ODBC Database. The SelectData Source
window opens. 3. Select Dynamics NAV ODBC Sample as the DSN. The
LinkTables window opens. 4. Select Location and then click OK. 5.
Double-click the Location table in Microsoft Access. It displays
therecord from the Location table from Microsoft Dynamics NAV. 6.
Type the following.CodeName AddressBLACK Black2 Late
StWarehouse13-24Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 25. Chapter 13: Integration Options 7. Close the
table and close Microsoft Access. 8. Verify the record is added
from Microsoft Dynamics NAV from theLocation Card form.FIGURE 13.15
THE LOCATION CARD FORMC/FRONTC/FRONT is an application programming
interface that can be used to accessMicrosoft Dynamics NAV
databases. C/FRONT facilitates high-level interactionwith the
Microsoft Dynamics NAV database and allows developers to
manipulateany Microsoft Dynamics NAV database.The central component
of C/FRONT is a library of C functions. These functionsgive
developers access to every aspect of data storage and maintenance,
andallow developers to integrate both standard and custom
applications with theMicrosoft Dynamics NAV database.Because
C/FRONT is a front end to Microsoft Dynamics NAV, developers
mightwant to use C/FRONT to add, delete or view data from their own
applications.C/FRONT is much faster compared to the Microsoft
Dynamics NAV ODBCdriver and is as close to the native connection as
with Microsoft Dynamics NAV.However, to use C/FRONT, developers
must use some other programminglanguage such as C++, C, or Visual
Basic. C/FRONT provides two methods ofaccessing Microsoft Dynamics
NAV which is either through a C style DLL orthrough the use of the
OCX interface.RequirementsThere are several requirements to use
C/FRONT, they are as follows: License for C/FRONT granule. C/FRONT
is very particular and looks in different places at differenttimes
for the license file. Ensure that the license is loadedeverywhere
it needs to be, that is the client, server, and so on. Microsoft
Official Training Materials for Microsoft Dynamics 13-25Your use of
this content is subject to your current services agreement 26.
C/SIDE Introduction in Microsoft Dynamics NAV 2009 Users have
permission to access the database. For example, if a userdoes not
have read permission for specific table related data, theycannot
read that table from either the Microsoft Dynamics NAVclient or by
using C/FRONT. Also, users must have permission forSystem 9110,
C/FRONT. There are enough sessions for the users. Just as accessing
theMicrosoft Dynamics NAV database by using a client, accessing
thedatabase by using C/FRONT also requires a session.InstallationBy
default, C/FRONT is not installed when installing Microsoft
Dynamics NAV2009. The following figure shows the option to install
C/FRONT.FIGURE 13.16 INSTALL C/FRONTNOTE: When C/FRONT is
installed, two .dll files - cfront.dll and cfrontsql.dllare copied.
If Microsoft SQL Server is used, select cfrontsql.dll, otherwise
selectcfront.dll.Generally, the C/FRONT library
(cfront.dll/cfrontsql.dll) reads the registry tolocate the
Microsoft Dynamics NAV client. However, if multiple
MicrosoftDynamics NAV are installed or if Microsoft Dynamics NAV is
not present onthe system, the function SetNavisionPath in the
cfront.dll/cfrontsql.dll librarymust be called to specify the path
to the directory where Microsoft Dynamics13-26Microsoft Official
Training Materials for Microsoft Dynamics Your use of this content
is subject to your current services agreement 27. Chapter 13:
Integration OptionsNAV is installed or to a directory containing
the following files from MicrosoftDynamics
NAV.dbm.dllnc_netb.dllnc_tcp.dllslave.exefin.etxfin.stxfin.flfList
of C/FRONT FilesC/FRONT consists of the following files. File name
Description cfront.dllC/FRONT C-API library for Microsoft Dynamics
NAV Database Server cfrontsql.dll C/FRONT C-API library for
Microsoft SQL Server cfront.ocxC/FRONT OCX cf.hC/FRONT header file
libload.c Source file containing functions to load and unload
cfront.dll dberror.txt Database error/return codesA sample
application (written in C) and a .NET application are installed
togetherwith C/FRONT installation.LimitationsThere are several
limitations when working with C/FRONT, they are as follows:Entries
made by C/FRONT do not fire triggers to execute any code
validation.Only active keys are available to C/FRONT. Keys cannot
be activated within C/FRONT.Microsoft Windows does not go in to
standby or hibernation if there is an open server connection from
C/FRONT.OCXCustom controls are also known as OLE Controls and
Microsoft ActiveXControls. Because they often have the extension
.ocx, they are also known asOCXs. Microsoft Official Training
Materials for Microsoft Dynamics 13-27Your use of this content is
subject to your current services agreement 28. C/SIDE Introduction
in Microsoft Dynamics NAV 2009NOTE: Custom controls can also have
the extension .dll.OCX lets developers take advantage of code that
is made commercially availableor allows them to write code once and
have the ability to call that code from anyprogram that supports
custom controls.The main reason to use custom controls is to save
development time and reducecosts.RequirementsThere are several
requirements to use OCX, they are as follows: License for OCX
granule. This is needed only for development. Thecustomers, who run
the objects, do not need the OCX granule. Theyonly need the
compiled object loaded on their computers along withthe custom
control that needs to be registered. To use a custom control, it
must be loaded on the computer that isbeing used for development
and all other computers that use theapplication that uses the
custom control. Therefore, an important partof using an OCX that is
developed by another company is to ensurethat the developer working
on this has the license to redistribute theOCX. The OCX must be
installed on each machine that needs to usethe code. After the OCX
is copied to a machine, register the controlfrom the Microsoft
Dynamics NAV Classic client. Users must have permission for System
9140, C/OCX to be able torun an object that works with an
OCX.InstallationThe first requirement for using a custom control is
that it is physically installedon the target machine. But a control
also has to be registered with the operatingsystem to be used. If
the control is already physically installed by copying it tothe
hard disk, but is not yet registered, use the following steps to
register thecontrol from the Microsoft Dynamics NAV Classic client.
1. Copy the control from the distribution media to the hard disk.
2. On the Microsoft Dynamics NAV Classic client, click Tools,Custom
Controls. The Custom Controls window opens. 3. Click Control,
Browse. The Register Custom Control windowopens. 4. Locate the OCX,
select it, and click Open. This registers the controlwith the
system. A confirmation message appears after theregistration is
complete.13-28Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 29. Chapter 13: Integration Options5. Click OK
to return to the Custom Controls window. Verify that the control is
added by closing this window and click Tools, Custom Controls
again. FIGURE 13.17 THE CUSTOM CONTROLS WINDOW Limitations There
are several limitations when working with OCX, they are as follows:
When an object is modified and that object depends on an OCX that
is not registered on the development computer, the object cannot be
compiled. Incoming data must conform to C/AL data type. For
example, strings are limited to 1024 characters in Microsoft
Dynamics NAV. Therefore, custom controls being used must return the
appropriate string value. Only non-visual controls are supported.
This means graphical elements cannot be added to a C/SIDE object
(for example, a third party control cannot be added to a form).
However, developers can use controls that display information and
interact with the user in a window of its own. C/SIDE does not
allow the retrieval of information about exceptions from a control
or automation server through the Invoke method of the IDispatch
interface and the EXCEPINFO structure. There are ways to work
around this limitation. C/SIDE does not support call back for OCX.
Therefore, developers cannot respond to an event from
OCX.Demonstration: Use OCX Controls To demonstrate the ease of
registering and using a custom control in Microsoft Dynamics NAV,
the C/FRONT.OCX is used.Microsoft Official Training Materials for
Microsoft Dynamics 13-29 Your use of this content is subject to
your current services agreement 30. C/SIDE Introduction in
Microsoft Dynamics NAV 2009This demonstration uses this control to
create a form that connects to a server,opens a database, and then
opens a company and returns the number of records ina table. This
page has access to the functions and properties supported by
theC/FRONT OCX.Define Variables for the New FormThe following steps
show how to create a new page and define the necessaryvariables. 1.
Create a new blank form. 2. Click View, C/AL Globals. The C/AL
Globals window opens. 3. Define the following variables in the
Variables tab.NameDataTypeSubtypeLengthcfrontOCX
CFRONTControlTableNo IntegerMyCompany Text 50MyDatabaseText
50MyServerNameText 50DriverOption 4. Open the Properties window for
the Driver variable and set theOptionString property to
NDBCS,NDBCN. FIGURE 13.18 THE C/AL GLOBALS WINDOW 5. Close the
Properties window and compile and save the form withthe ID 90005
and the Name Test OCX Form.13-30Microsoft Official Training
Materials for Microsoft Dynamics Your use of this content is
subject to your current services agreement 31. Chapter 13:
Integration OptionsDesign the FormThe following steps show how to
add controls to the form. 1. Open the Toolbox and add five text
boxes with attached labels tothe form. 2. Set the Caption and
SourceExpr property of the text boxes asfollows:Text Box
CaptionSourceExpr 1 Server MyServerName 2 Database MyDatabase 3
CompanyMyCompany 4 Server TypeDriver 5 Table No.TableNo 3. Add a
command button to the form. 4. Set the Caption property of the
command button to Connect. FIGURE 13.19 THE FORM DESIGNERAdd Code
to the FormThe following steps show how to add code to the form. 1.
Select the command button, and then click View, C/AL Code. TheC/AL
Editor opens. Microsoft Official Training Materials for Microsoft
Dynamics 13-31Your use of this content is subject to your current
services agreement 32. C/SIDE Introduction in Microsoft Dynamics
NAV 2009 2. Type the following code in the OnPush trigger of the
button.CLEAR(cfront);cfront.ConnectServerAndOpenDatabase(FORMAT(Driver),MyServerName,tcp,MyDatabase,0,FALSE,TRUE,,);cfront.OpenCompany(MyCompany);IF
cfront.OpenTable(TableNo,TableNo) THENMESSAGE(The %2 table contains
%1records,cfront.RecCount(TableNo),cfront.TableName(TableNo));cfront.CloseTable(TableNo);MESSAGE(Table
closed);cfront.CloseCompany();MESSAGE(Company
Closed);cfront.DisconnectServer();MESSAGE(Disconnect) 3. Close the
C/AL Editor, and then compile, save and close the form.Run the
FormRun the form in the Classic client, enter valid information and
then click theConnect button.FIGURE 13.20 THE TEST OCX
FORMAutomation ServerAutomation provides a seamless interface to
applications outside MicrosoftDynamics NAV 2009 without user
intervention. For example, a letter can becreated in Microsoft Word
whenever certain conditions take place, such aswhen a new customer
is added.The main purpose of using Automation is to provide a
seamless interface tooutside applications without user
intervention. A second reason for usingautomation is to save
development time which also reduces the cost
ofdevelopment.13-32Microsoft Official Training Materials for
Microsoft Dynamics Your use of this content is subject to your
current services agreement 33. Chapter 13: Integration
OptionsRequirementsThere are several requirements to use
Automation, they are as follows: The program to be used as
Automation must be an Automationserver. Examples of automation
servers include Microsoft Word,Microsoft Excel, and Microsoft
Outlook. The Automation server must be loaded on the computer that
is beingused for development and all other computers that use
theapplication that use the Automation.InstallationThe following
steps outline the procedures for using an Automation server
fromC/SIDE. 1. Declare the top-level interface (class) of the
Automation server as avariable of type Automation. 2. Declare all
the other interfaces (classes) as variables of typeAutomation. 3.
Use the C/AL function CREATE on the variable declared in step 1.Do
not use CREATE on any other variables. 4. Use the methods and
properties of the Automation server in theC/AL code. Write the code
in this step. The syntax and thesemantics of these methods and
properties are described in thedocumentation for each Automation
server. Using these methodsand properties in C/AL does not involve
any new or modifiedsyntax. 5. Use the C/AL function CLEAR to
destroy the top-level object.Otherwise, it is destroyed
automatically when the variable goes outof
scope.ConsiderationsThere are two major concerns when deciding
where to write code that usesAutomation. The first is the fact that
an object that uses Automation can becompiled only if the
Automation server is installed on the machinewhere the compilation
takes place. This means that if an object is tobe recompiled and
modified on a machine where the Automationserver is not installed,
developers have to modify the code drasticallyto compile it again.
Therefore, it is recommended to isolate code thatuses Automation in
separate codeunits. Microsoft Official Training Materials for
Microsoft Dynamics 13-33Your use of this content is subject to your
current services agreement 34. C/SIDE Introduction in Microsoft
Dynamics NAV 2009 The second concern is performance. There is some
overheadinvolved in using an Automation server by using the
CREATEfunction call. If the Automation server is to be used
repetitively, itgives better performance if the code is arranged so
that theAutomation server is created only one time, as opposed to
using aseries of CREATE/CLEAR function calls.Because these two
concerns sometimes clash, there may be instances whendevelopers
must make some trade-offs based on the actual context in which
theircode is used.Creating the VariablesTo control a Automation
server, developers define a variable (global or local) oftype
Automation and reference the Automation Server as the subtype of
thisvariable. The only Automation Servers that appear in the list
are those that areloaded on the development machine.Once the
Automation Server is selected, a list of all the classes available
for thatAutomation server is displayed. Typically, the application
is the first classselected. Afterwards, declare variables for all
the other interfaces (classes) thatcontrol or interact with the
code.Determining what classes must be defined depends on the
understanding of theAutomation server. If these are Microsoft
programs, to determine what each ofthe classes do, view the
Microsoft Visual Basic Help. Generally, which classes touse is
determined by considering the application. For example, to call
MicrosoftWord, consider the application and then the document.
Likewise, if to callMicrosoft Excel, consider the application, the
workbook, the worksheet, and theRange of cells.Responding to
EventsC/SIDE can receive events from the Automation servers that it
controls. Whendeclaring a global variable of the type Automation,
set the WithEvents propertyfor the variable to specify whether to
receive events. Setting the WithEventsproperty to Yes automatically
generates C/AL triggers for the events that thecomponent provides.A
trigger name consists of the name of the Automation variable
followed by"::." For example, if an Automation variable named
MyEventVar,and the component provides the event
MessageReceived(...), the name of thetrigger is
MyEventVar::MessageReceived(...).NOTE: If a global variable of type
Automation is deleted, the event triggers andtheir code are also
deleted. Furthermore, if the DataType or SubType for aglobal
variable is modified, then all the event triggers and their code
are deleted.13-34Microsoft Official Training Materials for
Microsoft Dynamics Your use of this content is subject to your
current services agreement 35. Chapter 13: Integration Options
Limitations There are several limitations when working with
Automation, they are as follows: When an object is modified and
that object depends on an Automation that is not registered on the
development computer, the object cannot be compiled. C/SIDE does
not allow the retrieval of information about exceptions from a
control or automation server through the Invoke method of the
IDispatch interface and the EXCEPINFO structure. There are ways to
work around this limitation. Incoming data must conform to C/AL
data type. For example, strings are limited to 1024 characters in
Microsoft Dynamics NAV. In addition, when C/SIDE is enabled to
receive events from the Automation server, that is, the WithEvents
property is set to Yes, there are limitations to the triggers that
are automatically generated which are provided by the
Automation.Demonstration: Create a Report with Automation The
following demonstration shows how to create a report with
Automation capabilities. Define Variables for the New Report The
following steps show how to create a new report and define the
necessary variables.1.Create a new blank report.2.Add Customer for
the data item.3.Click View, C/AL Globals. The C/AL Globals window
opens.4.Define the following variables in the Variables tab. Name
DataType SubtypeLength CustAmount Record Customer Amount CustFilter
Text250 CustDateFilter Text 30 jText 30 NoOfRecordsToPrint Integer
iInteger MaxAmountDecimalMicrosoft Official Training Materials for
Microsoft Dynamics 13-35 Your use of this content is subject to
your current services agreement 36. C/SIDE Introduction in
Microsoft Dynamics NAV 2009 5. Open the Properties window for the
CustAmount variable, set theTemporary property to Yes and then
close the Properties window. 6. Define several other variables.Name
DataType Automation ServerAutomation ObjectExcelAutomation
Microsoft Excel 12.0 ApplicationObject LibraryBook Automation
Microsoft Excel 12.0 WorkbookObject LibraryRangeAutomation
Microsoft Excel 12.0 RangeObject LibrarySheetAutomation Microsoft
Excel 12.0 WorksheetObject LibraryChartAutomation Microsoft Excel
12.0 ChartObject LibraryNOTE: The Microsoft Excel version may
vary.FIGURE 13.21 THE C/AL GLOBALS WINDOW 7. Compile and save the
report with the ID 90002 and the NameSample
Automation.13-36Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 37. Chapter 13: Integration OptionsChange the
Report Properties and Add Code to theReportThe following steps show
how to change the report properties and add code tothe report. 1.
Open the Properties window for the report, and set
theProcessingOnly property to Yes, and then close the
Propertieswindow. 2. Click an empty line in the Report Designer and
then click View,C/AL Code. The C/AL Editor opens. 3. Add the
following code in the OnPreReport trigger.CustFilter :=
Customer.GETFILTERS;CustDateFilter := Customer.GETFILTER("Date
Filter"); 4. Close the C/AL Editor. 5. Click the Customer data
item, and then click View, C/AL Code.The C/AL Editor opens. 6. Add
the following code in the OnPreDataItem trigger.i :=
0;NoOfRecordsToPrint :=
10;CustAmount.DELETEALL;CurrReport.CREATETOTALS("Sales
(LCY)","Profit
(LCY)");CREATE(Excel);Excel.Visible(TRUE);Book:=Excel.Workbooks.Add(-4167);Sheet:=Excel.ActiveSheet;Sheet.Name
:= TOP 10;The first four lines of the code initialize values to
variables, delete records in theCustomer Amount table and maintain
totals for two fields when iterating theCustomer data item.The
fifth line creates an instance of Microsoft Excel and the sixth
line makes theMicrosoft Excel visible.NOTE: Microsoft Excel
generates a General Protection Fault error whenclosing an Excel
worksheet that is created when Microsoft Excel is invisible.
Tosolve the problem, make Microsoft Excel visible immediately after
a newworksheet is created. Alternatively, make Microsoft Excel
visible just beforecreating a new Excel worksheet, and then make it
invisible immediately after theworksheet is created. Microsoft
Official Training Materials for Microsoft Dynamics 13-37Your use of
this content is subject to your current services agreement 38.
C/SIDE Introduction in Microsoft Dynamics NAV 2009The seventh to
the tenth lines add a workbook to the application, use
theActiveSheet property of the application to ensure that what is
done next affectsthe active sheet of the new workbook and then give
a name to the sheet. 7. Add the following code in the
OnAfterGetRecord trigger.CALCFIELDS("Sales (LCY)","Profit
(LCY)");IF ("Sales (LCY)" = 0) AND ("Profit (LCY)" = 0)
THENCurrReport.SKIP;CustAmount.INIT;CustAmount."Customer No."
:="No.";CustAmount."Amount (LCY)" := -"Sales
(LCY)";CustAmount."Amount 2 (LCY)" := -"Profit
(LCY)";CustAmount.INSERT;IF (NoOfRecordsToPrint = 0) OR (i <
NoOfRecordsToPrint)THENi := i + 1ELSE
BEGINCustAmount.FINDLAST;CustAmount.DELETE;END;The first line of
the code calls the CALCFIELDS function to calculate the valuesfor
Sales (LCY) and Profit (LCY). The second line of the code checks
whetherboth the fields equal zero. If they do, the record is
skipped. Otherwise, itproceeds to the next lines of code.The third
to seventh lines of code initialize the CustAmount record, assign
theCustomer No. and the amounts field, and insert the record. The
negative value isused so that the graph displays upright.If the
NoOfRecordsToPrint equals zero or the value i is less than
theNoOfRecordsToPrint, increment i. Otherwise, find the last record
and delete it.The reason for doing this is that as a record is
inserted, the records are placed inorder from highest to lowest
(based on the key in the Customer Amount table).Therefore, the
CustAmount table will have only the top 10 records for
theamount.13-38Microsoft Official Training Materials for Microsoft
Dynamics Your use of this content is subject to your current
services agreement 39. Chapter 13: Integration Options 8. Add the
following code in the OnPostDataItem trigger.Sheet.Range(A2).Value
:= No.; Sheet.Range(B2).Value := Name; Sheet.Range(C2).Value :=
Sales (LCY); Sheet.Range(D2).Value := Profit (LCY);IF
CustAmount.FINDSET THEN BEGINj:=3;REPEAT
Customer.GET(CustAmount."Customer No."); Sheet.Range(A+j).Value :=
CustAmount."Customer No."; Sheet.Range(B+j).Value := Customer.Name;
Sheet.Range(C+j).Value := -CustAmount."Amount (LCY)";
Sheet.Range(D+j).Value := -CustAmount."Amount 2(LCY)";
j:=INCSTR(j);UNTIL CustAmount.NEXT = 0;
END;Range:=Sheet.Range(B3:D12); Chart:=Book.Charts.Add; Chart.Name
:= Top 10 Customers - Graph;
Chart.ChartWizard(Range,-4100,2,2,1,0,0,Top
10Customers,Customer,Sales (LCY));These lines of code write data
from the CustAmount table to the Microsoft Excelinstance. The last
five lines of code add a chart to the Microsoft Excel instanceby
first setting a range based on the rows and column in the Excel
sheet and thenusing the ChartWizard to plot the chart. 9. Compile,
save and close the report.Run the ReportRun the report in the
Classic client and click OK at the Request Form.FIGURE 13.22 THE
RESULT IN THE MICROSOFT EXCEL WORKSHEET Microsoft Official Training
Materials for Microsoft Dynamics 13-39Your use of this content is
subject to your current services agreement 40. C/SIDE Introduction
in Microsoft Dynamics NAV 2009The following chart is displayed in
Microsoft Excel.FIGURE 13.23 THE CHART IN THE MICROSOFT EXCEL
WORKSHEETSummaryMicrosoft Dynamics NAV 2009 offers a set of
technologies to integrate withexternal applications, they include
the following: Web service Microsoft Dynamics NAV ODBC C/FRONT OCX
AutomationEach of the technology has its own advantage and
disadvantage over one anotherand the choice of which technology to
use can depend on many factors.Understanding integration options
available to Microsoft Dynamics NAV 2009,completes the introduction
to C/SIDE development.13-40Microsoft Official Training Materials
for Microsoft Dynamics Your use of this content is subject to your
current services agreement 41. Chapter 13: Integration OptionsTest
Your Knowledge 1. What must be done to use Microsoft Dynamics NAV
ODBC? (Select thecorrect answers.) o Install Microsofts ODBC
driver. o Purchase the Microsoft Dynamics NAV ODBC granule. o Set
up permissions for the users. o Set up a DSN. 2. True or False. Any
Microsoft Dynamics NAV ODBC version can be used toopen up any
Microsoft Dynamics NAV database. 3. True or False. Microsoft
Dynamics NAV uses Microsofts ADO for allconnections. 4. True or
False. Microsoft Dynamics NAV ODBC driver supports outer joins. 5.
True or False. Entering data through ODBC is validated just as in
theMicrosoft Dynamics NAV client. 6. What is C/FRONT? 7. Does
C/FRONT use a session? 8. Can keys be activated from within
C/FRONT? 9. True or False. C/FRONT does not require any files from
the MicrosoftDynamics NAV client directory. 10. What is the purpose
of using OCX control? 11. What must be done to use OCX control? 12.
What may be the reason for not being able to select OCX as a data
type? 13. Is calling a method or setting properties of an OCX any
different from any other standard Microsoft Dynamics NAV object?
14. What is the purpose of using Automation in Microsoft Dynamics
NAV? 15. Yes or No. It is possible to respond to Automation Events
in Microsoft Dynamics NAV? 16. True or False. The CREATE function
must be used before using an Automation object. 17. True or False.
The FREE function is used to release the Automation object from
memory.Microsoft Official Training Materials for Microsoft Dynamics
13-41 Your use of this content is subject to your current services
agreement 42. C/SIDE Introduction in Microsoft Dynamics NAV
2009Quick Interaction: Lessons LearnedTake a moment and write down
three key points you have learned from
thischapter1.2.3.13-42Microsoft Official Training Materials for
Microsoft Dynamics Your use of this content is subject to your
current services agreement