Displaying Related Entity Data Using Calculated Fields

computer 3365366 960 720 300x225 Displaying Related Entity Data Using Calculated Fields

There are times when you need to display data from a related entity on a form without the overhead of replicating the information across entities. Quick View forms are a good way to do this if you are pulling multiple fields from the entity and displaying them in one column. To learn more on Quick View Forms, check out our previous post: Exploring the Quick View Forms in CRM 2013. If you need the flexibility to show fields in multiple columns or if you only need one field, calculated fields may be the way to go.

In this blog, we will show you how to use calculated fields to display discrete data from a related entity. To do this we will use the following scenario. Let’s say I need to display a Company’s Credit Limit on an Opportunity record. We can do this by adding a calculated field to the Opportunity Entity and then adding that to the Opportunity form. Let’s see it in action.

Step 1 – Create the Calculated field

1. Navigate to Settings > Customizations > Customize the System.

2. Expand the Opportunity entity and select Fields.

3. Click the New button.

060418 1655 DisplayingR1 Displaying Related Entity Data Using Calculated Fields

4. Add a Display Name and Description for the new field.

5. Select Calculated as the Field Type.

060418 1655 DisplayingR2 Displaying Related Entity Data Using Calculated Fields

Note: We are using the Currency Data Type for this field to ensure that the value is formatted correctly when we add it to the form.

6. Select the Edit button to open the Field Definition Editor.

060418 1655 DisplayingR3 Displaying Related Entity Data Using Calculated Fields

7. Next, we will want to add an Action by clicking the Add Action button.

060418 1655 DisplayingR4 Displaying Related Entity Data Using Calculated Fields

8. Click into the edit control and select parentaccountid from the list.

060418 1655 DisplayingR5 Displaying Related Entity Data Using Calculated Fields

9. Type a “.” after parentaccountid and select Credit Limit from the dropdown list.

Note: Adding the “.” after any lookup field will allow you to use related entity fields in your action step.

060418 1655 DisplayingR6 Displaying Related Entity Data Using Calculated Fields

10. Select the Check button to save your action.

060418 1655 DisplayingR7 Displaying Related Entity Data Using Calculated Fields

11. Click the Save a Close button on the Field Definition Editor to commit your changes

060418 1655 DisplayingR8 Displaying Related Entity Data Using Calculated Fields

12. Select Save and Close on the New Field from to update the system Schema

060418 1655 DisplayingR9 Displaying Related Entity Data Using Calculated Fields

Step 2 – Add the Calculated field to the Opportunity Form

1. Open the Opportunity Form where you would like to display Credit Limit and navigate to the appropriate section.

2. Select the Credit Limit field from the Field Explorer and add it to the form.

060418 1655 DisplayingR10 Displaying Related Entity Data Using Calculated Fields

3. Save and Publish your customizations.

4. Once you refresh your browser you will see the Credit Limit displayed on your Opportunity form.

060418 1655 DisplayingR11 Displaying Related Entity Data Using Calculated Fields

For more info and additional uses of calculated fields, visit the Calculated Fields section of The CRM Book!

Happy Dynamics 365’ing!

Let’s block ads! (Why?)

PowerObjects- Bringing Focus to Dynamics CRM