Using entities
When a developer creates a database instance in Common Data Service, it consists of a standard set of entities, with each entity having a standard set of fields. An entity is the Common Data Service equivalent of a table in other database management systems. A default Common Data Service instance has a base set of standard entities, as shown in Figure 2-2, any of which the developer can select and populate with data from an outside source.
FIGURE 2-2 Standard entities in a Common Data Service instance
In addition to the standard entities created with every Common Data Service instance, developers can create custom entities to suit the requirements of specific business applications, assuming that none of the standard entities are suitable. It is possible to rename a standard entity if that makes it more suitable to the application that will use it.
Creating a custom entity is simply a matter of clicking the +New entity button on the Entities screen in the Power Apps portal to open the dialog box shown in Figure 2-3, and supplying a name for the entity. After expanding the More settings header, the developer can specify the entity type and the ownership option. After the developer has created the new entity in the Power Apps portal, they can create custom fields within it.
FIGURE 2-3 New entity dialog box in the Power Apps portal
Aside from the Standard entity type, the developer can also choose the Activity entity type, which is an entity that can manage tasks for which it is possible to create a calendar entry, such as appointments, phone calls, faxes, and emails.
The other option for the Standard entity type is its ownership, which has the following options:
■ User or team—Actions that developers can perform on this entity’s records are controlled at the user level. User or team ownership is the only possible option for Activity entities.
■ Organization—Access to the data stored in the entity is controlled at the organization level.
Note Complex and Restricted Entities
Apart from standard and custom entities, Common Data Service also supports two other types of entities: complex entities and restricted entities. Complex entities include real-time workflows, plug-ins, or other types of server-side business logic. Restricted entities typically contain configuration data for specific products. Both of these entity types are typically not used by Power Apps citizen developers and have licensing requirements that go beyond the Power Apps/Power Automate Plan 1 license needed for standard and custom entities. For complex entities, users must have a Power Apps/Power Automate Plan 2 license. For restricted entities, users must have a license for the specific Dynamics 365 product that uses the entity, such as Dynamics 365 Sales or Customer Service.