Power Apps導讀

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/

寫這篇筆記的原因是官方文檔太多資料,我想快速上手,所以抽取了重要的段落組合起來。

1.Common Data Service(CDS)

1.1 Brief

Common Data Service lets you securely store and manage data that’s used by business applications.


Common Data Service includes a base set of standard entities that cover typical scenarios, but you can also create custom entities specific to your organization and populate them with data using Power Query.

1.2 Dynamics 365 applications and Common Data Service

Dynamics 365 applications, such as Dynamics 365 Sales, Dynamics 365 Customer Service or Dynamics 365 Talent, also use the Common Data Service to store and secure data used by the applications.


This enables you to build apps using Power Apps and the Common Data Service directly against your core business data already used within Dynamics 365 without the need for integration.

1.3 Common Data Service and Power Apps

Common Data Service is the underlying data platform for Power Apps that contains the core functionality such as server-side logic (plug-ins and workflows), business process flows, a highly sophisticated security model, and an extensible platform for developers to build apps.

2.Power Apps(PA)

Power Apps is a suite of apps, services, connectors and data platform that provides a rapid application development environment to build custom apps for your business needs.

Using Power Apps, you can quickly build custom business apps that connect to your business data stored either in the underlying data platform (Common Data Service) or in various online and on-premises data sources (SharePoint, Excel, Office 365, Dynamics 365, SQL Server, and so on).

3.Entity

3.1 Attributes

Attributes are listed in two separate sections: Writable attributes and Read-only attributes

3.2 Relationships

The relationships exist between the entities.
The EntityMetadata class includes three properties to represent relationships:

A. OneToManyRelationships

B. EntityMetadata.ManyToOneRelationships

C. EntityMetadata.ManyToManyRelationships
在這裏插入圖片描述

4.Way to Integrate Data

Way to Integrate Data into the Common Data Service

4.1 Brief

Common Data Service allows data to be integrated from multiple sources into a single store which can then be used in Power Apps, Power Automate, Power BI, and Power Virtual Agents along with data already available from the Dynamics 365 applications.

4.2 Ways

A. Scheduled integration with other systems
Data which is kept within another application can be regularly synchronized with the Common Data Service to allow you to leverage other applications data in Power Apps.

B. Transform and import data using PowerQuery Transforming data when importing into the Common Data Service can be done through PowerQuery from many online data sources, a common tool used across Excel and Power BI.

C. One time import of data
Simple import and export of Excel and CSV files can be used for a one time or infrequent import of data into the Common Data Service.

5.Common Data Service Developer Guide

5.1 Brief

There are many aspects to how developers can contribute to creating apps that use Common Data Service. While it is possible to build an application with code using Common Data Service as your data source, most projects will use either model-driven apps or canvas apps to generate the experience that people will use.

5.2 Canvas apps

Design and build a business app from a canvas in Microsoft Power Apps without writing code in a traditional programming language such as C#. Design the app by dragging and dropping elements onto a canvas, just as you would design a slide in PowerPoint. Create Excel-like expressions for specifying logic and working with data.

5.3 Model-driven apps

If you don’t need a custom design and your data is in Common Data Service, you can automatically generate a model-driven app from your business data and processes. This type of app can model forms, views, and other components, and the default UI automatically adjusts to phones, laptops, and other devices.


Model-driven app design is a component-focused approach to app development. Model-driven app design doesn’t require code and the apps you make can be simple or very complex. Unlike canvas app development where the designer has complete control over app layout, with model-driven apps much of the layout is determined for you and largely designated by the components you add to the app.
At a fundamental level, model-driven app making consists of three key focus areas:

A. Modeling business data

B. Defining business processes

C. Composing the app


Model-driven apps are built on Common Data Service, and can only connect to a Common Data Service environment. All the data that defines a model-driven app is stored within Common Data Service.

Model-driven apps share the method of distributing customizations and extensions used by Common Data Service using Solutions.


Model driven apps also have a number of points for developers to write code to extend. For information on what developers can do with model-driven apps, see Model-driven apps Developer Guide.


Some examples of model-driven apps available from Microsoft are Dynamics 365 Customer Service, Dynamics 365 Field Service, and Dynamics 365 Marketing.

5.4 Note

Because Common Data Service includes many capabilities for people to configure custom business logic without writing code, the most common scenarios for developers to contribute involve filling spaces in-between where existing features may not provide functionality you need to meet a requirement. Fortunately, Common Data Service provides many points for developers to extend the common functionality using code.


For a developer who will contribute to projects it is important that they understand what can be done without writing code. You should familiarize yourself with these capabilities. More information: What is Common Data Service?


Common Data Service is not available for on-premise deployments at this time.Content in this guide does not include information about options that are only available for on-premises or internet facing deployments (IFD). For information related to these options, see the Developer Guide for Dynamics 365 Customer Engagement (on-premises).

6.Developers: Get started with Common Data Service

Where to start depends on what problem you are trying to solve. This guide includes information about a wide range of capabilities and it is unlikely you will ever use all of them. The following sections include several of the key areas to begin.

6.1 Work with data using Web services

There are two different web services that you can use to work with data: Web API and Organization service.

Which one you should use depends on the type of project you are working on. More information: Work with data using code

6.2 Applying business logic

6.3 Integrate with external data

6.4 Common Data Service entities

6.5 Work with metadata

6.6 Use solutions to package and distribute extensions

6.7 Create client applications and authentication

7.Supported Customizations for Common Data Service

7.1 Brief

You can customize Common Data Service by using tools that are available in the Power Apps portal or that are described in the official documentation. These customizations are supported and can be upgraded.


Customizations made using methods other than those described here are unsupported and could cause problems during updates and upgrades to Common Data Service. For more information, see Unsupported Customizations.

7.2 Customizations using Power Apps portal

7.3 Customizations applied using code

A. Solution file

a. Modification of an unmanaged solution file is supported as described in this documentation. Certain customization tasks for model-driven apps can be performed using these steps:
1.Export a solution component as an unmanaged solution.
2.Extract the contents of the solution package.
3.Edit the Customizations.xml file.
4.Repackage the solutions file.
5.Import the modified solution.

b. The following supported tasks can be performed using this procedure:
1.Ribbon customization.
2.Application navigation customization using SiteMap.
3.Form and dashboard customization using FormXml.
4.Saved query customization.


B. Plug-ins
The ability to create custom business logic using the plug-in mechanism described in this documentation is fully supported and upgradeable. Plug-ins can only be registered and executed in the sandbox (isolation). More information: Plug-ins

A plug-in is a .NET assembly that you can upload to the Common Data Service.


C. Workflow extensions
The ability to create custom workflow activities (assemblies) to be called from workflow rules is fully supported and upgradeable. Custom workflow activities can only be registered and executed in the sandbox (isolation). More information: Workflow extensions

7.4 Support for .NET Framework Versions

7.5 Unsupported customizations

Modifications to Common Data Service that are made without using either the methods described in this documentation or Common Data Service tools are not supported and are not preserved during updates or upgrades of Common Data Service. Anything that is not documented in this documentation and supporting documents is not supported. Additionally, unsupported modifications could cause problems when you update through the addition of hotfixes or service packs or upgrade Common Data Service.

The following is a list of unsupported action types that are frequently asked about:…

8.Work with data using code

Use web services to work with data in Common Data Service

Common Data Service provides two web services that you can use to interact with data: Web API and Organization Service. Choose the one that best matches the requirement and your skills.

在這裏插入圖片描述

8.1 Web API

The Web API is an OData v4 RESTful endpoint. Use this for any programming language that supports HTTP requests and authentication using OAuth 2.0.

More information: Use the Common Data Service Web API

8.2 Organization service

Use the .NET Framework SDK assemblies for projects that involve writing plug-ins or workflow extensions.

More information: Use the Common Data Service Organization Service.

Note:
Use the Xrm.Tooling assemblies if you are creating a Windows client application. More information: Build Windows client applications using the XRM tools.

9.Use the Common Data Service Web API

9.1 Brief

The Web API is one of two web services you can use to work with data and metadata in Common Data Service. The other is the Organization Service.


The Common Data Service Web API 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), version 4.0, an OASIS standard for building and consuming RESTful APIs over rich data sources. You can learn more about this protocol at https://www.odata.org/. Details about this standard are available at https://www.oasis-open.org/standards#odatav4.0.
Because the Web API is built on open standards, we don’t provide assemblies for a specific developer experience. You can compose HTTP requests for specific operations or use third-party libraries to generate classes for whatever language or platform you want. You can find a list of libraries that support OData version 4.0 at https://www.odata.org/libraries/.

9.2 Web API and the Organization service

It is valuable to recognize that the organization service is what defines the platform. The Web API provides a RESTful programming experience but ultimately all data operations go through the underlying organization service. The organization service defines the supported operations as messages. Each message has a name. These names are bound to the events used in the event framework to evaluate what registered extensions should be initiated. More information: Event Framework


The Web API allows you to do all the same operations as the organization service but presents them in an RESTful style. OData v4 provides for named operations via functions or actions. Most messages available in the organization service are exposed as a corresponding named function or action. Those messages that correspond to CRUD operations are not available in the Web API because as a RESTful service they have implementations using GET, POST, PATCH, and DELETE HTTP methods, but within the platform the retrieve, create, update, and delete messages are invoked just as they are when the corresponding operations are performed using the .NET Framework assemblies.

10. Get started with Common Data Service Web API (C#)

This section shows you how to access the Common Data Service Web API using the C# programming language. The first topic, Quick Start: Web API sample (C#), provides the quickest example of how to accomplish this, as all source code is simplified and provided in one file. The rest of this section shows you how to create and configure Visual Studio projects that use the Common Data Service Web API to perform common business data operations.

After completing this guide, you will have learned enough to explore the many other business operations that are supported by the Common Data Service Web API. You will also have a better understanding about how the Web API Samples (C#) are structured.

10.1 Quick Start: Web API sample (C#)

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/quick-start-console-app-csharp

10.2 Enhanced quick start (C#)

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/enhanced-quick-start

10.3 Start Web API project in Visual Studio

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/start-web-api-project-visual-studio-csharp

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章