A field is a column in the system which holds the data in the database. Fields can also be defined as the individual data items that can be used to store data in an entity. Fields are sometimes called attributes by developers. You can use the customization tools in the solution explorer to edit system fields that allow customization.
Fields can be further classified as following:
System fields:
These are out-of-the-box fields that cannot be deleted but can be modified to some extent.
Custom fields:
These are fields that are built within the system and can be modified and deleted.
How to create custom fields?
We will continue from our last topic, how the customize custom entity. We will take it as a demo project in which we will work on Employee entity and will add more custom entity as per the requirement.
Step 1:
Advance setting > Settings > Solutions > Select the solution/create solution and add employee entity > select fields > click create new fields

Step 2(Simple text field):
Add details as shown in the image below:

Display Name:
The name of the field.
Name:
This field will be used later in web resources and plugins for extended server side and client side coding.
Field Security:
This field allows read/write/update permissions on field level. Blog coming soon.
Auditing:
This field enable user to have track on the field’s value changes, if auditing is enabled. Blog coming soon.
Field Requirement:
- Business required: If it is selected the field becomes mandatory. This means at the time of creating record, you need to fill in the details to save the record.
- Business recommended: The record can be saved even if there is no data in this field. However, a blue asterisk appears next to the field to indicate it is important.
- Optional: This make field non-mandatory.
Searchable:
When a field is made searchable, it appears in the list of fields which users can select for queries in an advanced find.
Description:
This is a text box for giving details about the field for the system customizers.
Data Type:
This field is an option set of the different field types. Single Line of Text, Option Set, Multi-Option Select, Two Options, Image, Whole Number, Floating Point Number, Decimal Number, Currency, Multiple Lines of Text, Date and Time, Lookup, and Customer. We will discuss of these types in every step.
Format:
Depending on data type, it may have the options of Email, Text, Text Area, URL, Ticker Symbol and Phone.
Maximum Length:
Allocation of maximum characters in the field.
IME Mode:
An Input Method Editor (IME) lets you to enter and edit Chinese, Japanese, and Korean characters.
Step 3:
Add date of joining(DOJ) field by clicking on New.

Data type:
Date and Time
Behavior:
User local: The field values are displayed in the user’s local time and formatted as per their current portal language/locale.
Date only: The field values only contain the date and are displayed with no time zone conversion. The time portion of the value is always 12:00 AM. The value entered by one user is seen the same by other users in different time zones (for example, birth dates).
Time-Zone Independent: The field values contain date and time, and are displayed with no time zone conversion. The value entered by one user is seen the same by other users in different time zones.
Format:
Date only: User can add date only in the field.
Date and Time: User can add date and time in the field.
Step 4:
Till now we have only created the fields. However, created fields will not be visible on the form. How to add fields in form?
Step 5:
We will create new custom entity as “Expense”. How to create entity?
Step 6:
Add new field as Billable with data type: Two options.

Step 7:
Create Date field in Expense entity. Refer to Step 3.
Step 8:
Add new field Employee as data type: lookup, in expense entity. This will create a N:1 relationship, which means employee can have multiple expense records.

Select the target entity from Target Record Type.
Relationship name will be auto populated.
Types of entity relationships:
1:N (One-to-Many):
An entity relationship where one entity record for the Primary Entity can be associated to many other Related Entity records because of a lookup field on the related entity.
N:1 (many-to-one):
An entity relationship type exists in the solution explorer user interface because the solution explorer shows you a view grouped by entities. 1:N relationships actually exist between entities and refer to each entity as either a Primary Entity or Related Entity.
N:N (Many-to-Many):
An entity relationship that depends on a special Relationship Entity, sometimes called an Intersect entity, so that many records of one entity can be related to many records of another entity.
Step 9:
We will create another custom entity as “Expense Lines”
Step 10:
Add new field Expense type with data type: Option set and add the values as shown in the screenshot:

Default values: This enables user to assign a value to the field or leave it unassigned.
Add options by clicking on the plus button. Fill in the name in the label attribute. Value will be populated automatically. These values are used in the client side and server side coding.
Step 11:
Create currency field as Total.

Precision: Precision beyond decimal value. Example: Currency precision – 2, Value will be 0.02 and Currency precision – 1, value will be 0.1
Step 12:
Create new field, Expense with data type: lookup and the target entity will be Expense.

Step 13:
Create date field in Expense line. For more details, refer to step 3.
Step 14:
Create new field Description as Multiple lines of text .

Maximum Length: The maximum character a field can hold and maximum range in Dynamics 365 is 4000 character.
Step 15:
Create a new field, Total , data type currency and field type roll-up. Save and create the field. Click edit button to configure the roll up field.
Roll-up fields are updated in every 12 hours.


Add details in the related entity and in aggregation block.



Lookup relationship enables user to add roll-up summary fields else there will be no aggregation or calculations.
Step 16:
Always remember to add the created fields in the form and most important, click publish all customization or else your changes won’t reflect on the form.
To add fields in the form follow the steps:
Expand entity > click Forms > click on information form with form type Main > Drag and drop the fields

Click save and publish the customization. Repeat for other two entities.
Step 17:
Create record for employee, expense and expense line.








Step 18:
Click on recalculate button and sum of all related record will populate.




With this, we have covered most of the components and features provided by Microsoft for fields. You can also explore more about fields and if you find any difficulty or issue then write your query in the comment section. Have a great day 🙂

