Scenario 1

The teacher of a class wishes to maintain the attendance records of every student in any given year.

The standard behind designing any solution in Microsoft Dynamics CRM 2016 is to avoid as much custom code as possible. It makes the customizations easy to maintain and upgrade if we end up moving to newer versions of CRM. Here, again, we will try to achieve the same.

As stated in the mapping section, we identified that Attendance of any student can be captured as a custom activity record. The following steps explain how the scenario can be achieved:

  1. Creating the attendance entity: In the following screenshot, review the Define as an activity entity check box:
Scenario 1 : Attendance entity

On creating the entity, a 1:N relationship between Contact and Attendance should get automatically created:

Contact relationship
When we say that a 1:N relationship exists between entity A and entity B, we mean that one record of A can be connected to multiple records of B; however, one record of B must be associated with only one record of A. On the other hand, when an N:N relationship exists between two entities, it means that one record of B can be connected to multiple instances of A, and vice versa.
  1. Now, navigate to Contact and create a new whole number field for the previous year's attendance. Note that its field type should be Rollup. Refer to the following screenshot:
Scenario 1: Attendance Attribute
  1. Save the attribute and click on the Edit button. A popup for entering the criteria of the Rollup field opens:
Scenario 1 : Rollup field
  1. As shown in the following screenshot, click on the Related drop-down menu to select the related entity on which the user wishes to configure the Rollup field:
Scenario 1: Rollup field
  1. After selecting the Attendance entity, we need to define the filter criteria. As the user is only interested in the attendance records of the previous year, we will define the filter criteria accordingly. Refer to the following screenshot, where the start date of the attendance is being set to be greater than a particular date. Therefore, it will only pick the count of attendance records of the current year:
Scenario 1: Attendance filter
  1. After the filter criteria are defined, the next step is to define the AGGREGRATION function. We are only concerned with the actual number of attendance records:
Scenario 1: AGGREGRATION
  1. Once the criteria are defined, we save and close the screen. The next step is to just add the field to the student form:
Scenario 1 : Contact form

By default, the field will be refreshed every 12 hours. The user can also click on the refresh icon to refresh the fields manually. The user can also modify the settings to update the Rollup fields to be refreshed in shorter intervals of time. You can also visit the MSDN article for the same at https://technet.microsoft.com/en-us/library/dn832162.aspx#Rollupcalculations.

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

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