Creating a custom entity

Let's imagine that we want to create the entity that we discussed in the Understanding Functional and technical design section in Chapter 4, Preparing Functional and Technical Design Documents. We are going to create a vehicle entity to store our customer's vehicle information using the following steps:

  1. First, we will create our custom solution. Let's imagine we want to name it HIMBAP Auto Service. Navigate to Solutions from make.powerapps.com and click on the New solution button. We can follow the numbering sequence shown in the screenshot here:

  1. Let's say we want to create our new publisher. So, select the Publisher dropdown, and then select the + Publisher option. This will open the New Publisher window, as shown in the following screenshot. While creating the publisher, we can fill in the information shown in the following numbered sequence:

Let's look at the important fields in this section, as follows:

  • Display Name will be displayed for the publisher under publisher lookup. For example, when we try to select a publisher for our solution, we will be able to see this name. Using this name means we can identify our publisher's record.
  • The Name field is automatically filled by the system, but we can change it if required. This name is assigned by the system internally, or we can assign it while working with publisher records using the Dynamics 365 CE Software Development Kit (SDK).
  • Prefix is a very important field in Publisher and can be used to identify who has customized or created this field. The default publisher for our organization uses the new prefix, but we can change it based on our requirements. When we change the prefix, we can see how it will be used for naming new entities in a preview.
  • The Option Value Prefix value represents the number sequence that will be used for new option set values. By default, this is automatically filled by the system, but it can be changed if required.

In addition to the preceding information, we can also include our company details—such as contact information and address—while creating a publisher. Keep in mind that once we have created a new entity and its field using our new publisher, we can't modify the prefix of the entity. In case you want to change the prefix, you have to delete the entity and need to recreate this under another publisher.

Once our solution is created, navigate to the Entities option and click on New from the right-hand side solution component command bar. This will open an entity editor for us. While creating an entity, we can use the following information:

  • The Display Name label will be used to display our entity in the Dynamics 365 CE application.
  • The Plural Name label will be used in all the navigation area.
  • The Name label will be used to set up an entity table in the Dynamics 365 CE database, and we will be using this name while working with SDK code.
  • The Virtual Entity field is used to create virtual entities. We can use this type of entity to display data from different databases from outside of Dynamics 365 CE.
  • The Ownership field is used to handle entity security requirements. We can set up entity ownership using the following two options:
  • User or Team: We use this option when we want to control the visibility of the entity using security roles. When this option is selected, we can set up an entity record owner as an individual user or team. This option allows us to control the security of this entity at various levels. We will discuss access levels when looking at security roles.
  • Organization: When we use this option to create an entity, the entity will be available to all Dynamics 365 CE users, or not available to any users at all.

While setting up ownership, we need to make sure we are setting it up correctly, based on requirements. If we want to make our entity available to all users without any restrictions, we can create an organization-level entity, or we can create a user- or team-level entity.

  • The Define as an Activity Entity option is used to create an activity-type entity. This adds some additional PartyList fields and enables the default setting to automatically be applied to our entity.
  • Primary Image: This field can be used to set up an entity image. We can create an image-type field for our entity and can select that field here after our entity is created.
  • The Color field is used to set up the entity icon color.
  • Description provides an entity description—for example, the reason why we are going to use this entity.
  • The Areas that display this entity section displays all of the possible navigation areas available in our Dynamics 365 CE organization. We can select areas in which we want to display our entity.
  • The Business Process Flowoption is used if we want to set up business process flows for our entity, which can guide users visually.
When an entity is created as an activity type, it adds some other mandatory settings, such as Enable AttachmentsAllow FeedbackEnable ConnectionsEnable Queues, and Duplicate Detection. On the other hand, some of the options—such as activity task, send email to entity, and support mail merge—are not available for this type of entity. 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset