Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 9.78 KB

File metadata and controls

84 lines (57 loc) · 9.78 KB
title description ms.custom ms.date ms.reviewer ms.suite ms.tgt_pltfrm ms.topic applies_to ms.assetid author ms.author tags search.audienceType
Programming models (Developer Guide for Dynamics 365 Customer Engagement (on-premises))| MicrosoftDocs
Dynamics 365 Customer Engagement (on-premises) offers several programming models designed to give you the flexibility to decide what works best for your needs.
03/29/2019
pehecke
get-started
Dynamics 365 Customer Engagement (on-premises)
14127ed4-0506-4071-a408-6052048ba299
JimDaly
jdaly
aug2017
MigrationHO
developer

Programming models for Dynamics 365 Customer Engagement (on-premises)

Microsoft Dynamics 365 Customer Engagement (on-premises) offers several programming models designed to give you the flexibility to decide what works best for your needs.

The following diagram illustrates the key programmability scenarios for Dynamics 365 Customer Engagement (on-premises). Use the appropriate Dynamics 365 Customer Engagement (on-premises) programming models for the type of solutions you create.

Programmability Scenarios for Dynamics 365 Customer Engagement (on-premises).

Connecting to Dynamics 365 Customer Engagement (on-premises)

When you write clients to access data in Dynamics 365 Customer Engagement (on-premises) you have two options: you can use the Web API or the organization service.

Web API

The Web API was introduced with [!INCLUDEpn_crm_2016_and_online_full] and it provides a development experience that can be used across a wide variety of programming languages, platforms, and devices. The Web API implements the OData (Open Data Protocol) v4. OData is an OASIS standard for building and consuming RESTful APIs over rich data sources.

When you use the Web API, you can choose from a list of community-supported libraries that support the OData v4 standard. You can also choose to write code using HTTP directly. [!INCLUDEproc_more_information] Use the Dynamics 365 Customer Engagement Web API

When you connect to [!INCLUDEpn_CRM_Online] (on-premises) environments with Internet-facing deployment (IFD), you can use Azure AD Authentication Libraries (ADAL) to enable authentication from a wide variety of programming languages and platforms. [!INCLUDEproc_more_information] Authenticate to Dynamics 365 Customer Engagement (on-premises) with the Web API

Note

The Azure ADAL library is deprecated. Use the Microsoft Authentication Library (MSAL) instead.

The organization data service ("REST endpoint" or "OData endpoint") is an OData v2 service that was deprecated in [!INCLUDEpn_crm_2016_and_online_full] in favor of the Web API. The organization data service isn’t included in the preceding diagram. The organization service is still available to support code that used it. However, for any new development for Dynamics 365 Customer Engagement (on-premises) we recommend using the Web API. [!INCLUDEproc_more_information] Use the OData endpoint with web resources

Organization service

If you are a .NET developer you can use either the Web API or the organization service. With the organization service you can use a set of assemblies and tools to generate strongly typed classes that include custom entities and attributes that have been added to an instance of Dynamics 365 Customer Engagement (on-premises).

With SDK assemblies and tools for code generation you can also include an xref:Microsoft.Xrm.Sdk.Client.OrganizationServiceContext, which is based on the same concept as the DataServiceContext in [!INCLUDEpn_WCF_long] Data Services. This class lets you track changes, manage identities and relationships, and gives you access to the Dynamics 365 Customer Engagement (on-premises) [!INCLUDEpn_LINQ] provider so you can build queries using LINQ. When you use the tools for code generation, you get strongly typed classes for entities and attributes that are defined when the code generation tool is run. These are called early-bound classes. [!INCLUDEproc_more_information] Use the Early Bound Entity Classes in Code

When your code needs to work with entities and attributes that weren’t known at the time that the code generation tools were run, you can use an xref:Microsoft.Xrm.Sdk.Entity class that allows for specifying entities and entity attribute in your code. This late-bound style of writing code provides greater flexibility but doesn’t allow for compile-time checking of all types so that no implicit casts occur. Late binding checks types only when the object is created or an action is performed on the type. The Entity class requires types to be explicitly specified to prevent implicit casts. [!INCLUDEproc_more_information] Use the Late Bound Entity Class in Code

If you create a [!INCLUDEpn_ms_Windows_short] client or are using [!INCLUDEpn_PowerShell], Xrm.Tooling provides a set of APIs that use the SDK assemblies to provide additional capabilities and resources specifically for [!INCLUDEpn_ms_Windows_short] client development. [!INCLUDEproc_more_information] Build Windows client applications using the XRM tools

Extending on the server

You can write code that listens for events and applies custom business logic to modify or augment the standard behavior of the platform. This code is only available to be written using .NET managed code and the developer experience is based on the same objects defined in the SDK assemblies. You can work with the organization service to perform operations with Dynamics 365 Customer Engagement (on-premises) data. [!INCLUDEproc_more_information] Write Plug-Ins to Extend Business Processes.

You can also create custom processes based on the Windows Workflow Foundation programming model. You can create several different types of processes. Most of the time you’ll use the workflow designer. But when there is some capability you can’t achieve in the designer, you can define processes using code. [!INCLUDEproc_more_information] Write Workflows to Automate Business Processes

Extending in the application

Each of the client applications provided by Dynamics 365 Customer Engagement (on-premises) includes the ability to define customizations and deploy to multiple types of clients. The web application, [!INCLUDEpn_crm_for_outlook_full], [!INCLUDEpn_moca_short], and [!INCLUDEpn_Mobile_Express_short] each provide capabilities to include custom navigation and command options as well as the Xrm object model and Xrm.Utility functions you can use with [!INCLUDEpn_JavaScript] to provide responsive experiences in the client. [!INCLUDEpn_JavaScript] libraries, HTML pages, images, and other types of files that can be used or displayed in the client are available as URL addressable web resources. [!INCLUDEproc_more_information] Use JavaScript with Customer Enagement apps and Web Resources for Dynamics 365 Customer Engagement (on-premises).

When you need to access Dynamics 365 Customer Engagement (on-premises) data that isn’t available in the context where your [!INCLUDEpn_JavaScript] code is running, you can make calls to the server to get the data you need. The organization service can be used, but it is much easier to use the Web API with JSON rather than the XML required by the organization service. Because your script runs in the context of the application, you are automatically authenticated. [!INCLUDEproc_more_information] Get started with the Dynamics 365 Customer Engagement Web API (client-side JavaScript)

See also

Developer Guide for Dynamics 365 Customer Engagement (on-premises)
Get started
Tutorials and resources
Best practices
Developer tools

[!INCLUDEfooter-include]