Understanding field types

While creating custom fields, some data types allow us to configure the field type. This defines whether we can input values into this field or if values will be calculated for this field. We can set up the following field types:

Simple field type

This is used for a field that does not require any automatic calculation.

Calculated field type

This is used to autocalculate values based on the formula used. We can use calculated fields for the following data types:

  • Single Line of Text
  • Option Set
  • Two Options
  • Decimal Number
  • Currency
  • Date and Time

We can use a formula by using the Edit button available next to the field type option. Let's imagine we have an Issue Date field in the Vehicle entity that displays when the vehicle was issued, and we now want to add a Vehicle Expiry Date field. By default, the vehicle expires 15 years after the issue date. Take the following step to add Issue Date and Registration Expiry fields to the Vehicle entity:

Click on the Add field button and fill in the following options:

  • Display name: Issue Date
  • Set Data type as Date and Time

Keep all options as their defaults and then click on Done, and click on the Add field button to create an Expiry Date field. To set up Registration Expiry as a calculated field, click on the New button and fill in the following options:

  • Display name: Expiry Date
  • Set Date type as Date and Time
  • Click on the + Add button under Calculated or Rollup and select + Calculation.
  • Click on the Save button on the entity save notification.
  • Reopen the field and click on the Open Calculation link under the field property window. Fill in the formula, as shown in the following screenshot:

Here, the him_issuedate field is the date field that we created in the earlier step. Now, the Registration Expiry field value is autocalculated based on the issue date field value.

Rollup field

This is also a calculated field; however, this field is used to calculate the aggregated value using aggregate functions such as SUM, COUNT, MAX, MIN, and AVG from a related entity. Similar to the calculated field, we can also set up our rollup formula for the rollup field calculation. Values for rollup fields are calculated using an asynchronous system job in the background. We can see all of the rollup system jobs by navigating to Settings | System Jobs | View | Recurring System Jobs.

Now that we know how to create fields and set up field properties, we can refer to Appendix A for complete field details for the Vehicle entity and add them in the same way that we added the preceding fields. Once we have set up all the fields, we can design our vehicle form. Let's first understand form types in Dynamics 365 CE.

..................Content has been hidden....................

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