Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

Our blog provides a curated collection of tips, tricks, and code snippets that streamline your workflow and enhance your proficiency.
Unleashing Dynamics 365 Excellence: Your Source for Pro Tips and Snippets at D365Snippets.com

Field Groups in D365 FO with Example


In the previous article, I explained how to set an Index on a Table. In this article, I will explain, how to create field groups and how to use them in Microsoft Dynamics 365 F&O.

Field Groups in D365 FO with Example

What are Field Groups?

Field groups are Objects which can exist on tables, maps, or views, and that can group fields logically together into a single Object. These field groups you can use to appear on the user interfaces like forms, gridviews, reports, etc. You should define a field group when several fields participate in a single function or are related in some way and are shown together on forms and reports.

Example for Field Groups?

In D365 F&O, the Customer Table contains many fields and field groups, The Credit field group contains fields that relate to credit like MandatoryCreditLimit and CreditRating.

How do field groups make it easier to create a logical layout in a form or reports in D365 FO?

  • You can add the whole group of fields to a form or report in one step instead of moving them individually.
  • The label given to the label groups can be displayed on the User Interfaces like forms or reports.
  • You can use these field groups globally and can be accessed on any form or report.
  • Any changes made in the field groups will reflect in all forms and reports that use it.

In D365 FO, when we create a table, map, or view, two field groups are automatically created which are AutoReport and AutoLookup. Where AutoReport is used to create the system’s automatic reports and AutoLookup is used in lookup forms. 

How to create Field Groups?

Suppose we have an Employee Master Table which stores Employee Basic Details and all the employee documents related details like passport, driving license, Health Card, etc. as shown in the below figure.

Field Groups in D365 FO with Example

suppose we have a client requirement that the client needs to display only the employee passport-related details in a grid view of a form. So here as a developer, you can do it in two different ways. 

The first method is, you can directly assign the fields PassportNumber, PPIssueDate, and PPExpiryDate to the grid view of the form. 

The second method is you can create a Filed Group, which holds only Employee Passport Related Details. 

Here the second method of using a Filed Group is the recommended method.

So here you can follow the below steps.

If you are a beginner or a learner, you can use Microsoft’s learning platform for practicing D365 FO scenarios. There you can access both the technical and functional environments for practicing more.

1. Create a Table 

If you are a beginner, you can visit the article “How to create a Table in D365”, Here we are creating a table with the Name “TblEmployee” as shown below.

Field Groups in D365 FO with Example

2. Create a Field Group

For this,

Right-click Field Groups, and then click New Group. This will add a new field group called by Default the name will be Group1. You can change the Field Group name according to your requirement.

Field Groups in D365 FO with Example

In our project, I put the field group name as EmpPassportDetails. For this Right click the new field group, click Properties and then type a name for the field group in the Name property.

3. Drag and Drop the Required Fields

For this,

Right-click the table, click Open New Window, and then expand the Fields node, In the new window, drag fields from the Fields node onto your new field group. In our field group, we drag and drop the fields EmpId, EmpName, PassportNumber, PPIssueDate, and PPExpiryDate as shown in the below image.

Field Groups in D365 FO with Example

Save then build the project to get the updated version of the table EmpTable.

4. Create a Form

For this,

Right-click on the project name in the Solution Explorer, scroll to Add, and select New Item. In the Items menu to the left, select User Interface and then select Form. Rename the form to EmployeeDetails.

Field Groups in D365 FO with Example

5. Set Data Source Property of the Form

For this,

Drag and drop the table EmpTable from solution explore to the Data Source node of the form EmployeeDetails.

Field Groups in D365 FO with Example

6. Add a Grid View to the form.

For this right click on the form design window and add the grid view as shown in the window.

Field Groups in D365 FO with Example

7. Drag and Drop Field Group to the Grid View

For this, 

Open the field group node from the Data Source node of the Form EmployeeDetails. Then drag and drop the fieldGroup EmpPassportDetails as shown in the figure.

Field Groups in D365 FO with Example

Then right-click on the Grid View and go to the properties window, assign table TblEmployee as the Data Source Property of the grid view, and assign field group EmpPassportDetails as the Data Group property of the grid view.

And change the label property of each field to the required labels to display on the column header of the grid view.

Now all the steps are completed. Now you can build and run the project, 

Before running the project, you create a menu and assign the form to the menu. Finally, you will get the output as shown in the below figure. 

Field Groups in D365 FO with Example

Through the next articles, we will also learn how to set indexes and how to set field groups on a table, and how to create a relation to another table. If this post is useful for you, try to share this with your friends also. You can explore more tutorials from this blog. Happy coding with D365snippets.

Some Useful Tags

What is an example of a field group?
How do I create a field group?
What is called a group field?
What are item groups in d365?
field groups in d365fo
field groups in ax 2012
auto report field group in ax 2012
field groups in business central
nav field groups
dialog form in d365
simple list form in d365
dynamics 365 drop-down lists.

Post a Comment

Post a Comment (0)