Let the platform do the work

Understanding Relate Fields in SugarBPM

Overview

SugarBPM™ is a powerful tool for automating business processes. One way it does this is by evaluating and setting field values based on your specifications. When these capabilities are applied to Sugar's versatile "relate" fields, you can create automated processes based on the relationship between records rather than simply on the records themselves. However, there are some important distinctions to understand when it comes to the types of relate fields available in Sugar that may save you time and frustration by enabling you to use them properly within SugarBPM. This article explains the various types of relate fields in Sugar and how to use them with SugarBPM.

Note: The SugarBPM features described in this article pertain to the latest Sugar release. If you are not using the latest release, some functionality may not yet be available for your version.

Summary of Concepts

This article talks about several concepts in Sugar on the topic of relationships and relate fields. The difference between some of these concepts is minor but the distinction is important when understanding how relationships are handled by SugarBPM. The following is a summary of these concepts that will help you navigate the comparison table later on this page:

  • Relationships: Relationships are the links that allow records between modules to be related.
  • Stock relate fields: Stock relate fields come out of the box with Sugar and associate a record with another module's record in a one-way fashion. These fields are always created automatically by way of a relationship and therefore are always based on a relationship. 
  • Custom relate fields created via a relationship: Custom relate fields created via a relationship are automatically generated when an admin creates a new relationship in Studio. These fields function the same as stock relate fields, which are always generated from a relationship.
  • Custom relate fields with no relationship: Custom relate fields with no relationship are created manually by the admin in the Fields page of Studio to associate a record with another module's record in a one-way fashion. These fields do not have a relationship and it is not possible to add a relationship after the fact.

For more information, refer to the Introduction to Relationships and Relate Fields article.

Comparison of Relate Fields in SugarBPM Modules

The table below outlines the capabilities and limitations of relate fields in SugarBPM modules. See the Summary of Concepts section above to understand the concepts the table refers to, such as relationships and relate fields, when outlining these capabilities.

Note: Flex-relate fields are not available in SugarBPM in any way. This table only discusses relate fields.

Module

Function

Stock or Custom Relate Fields Generated by a Relationship

Custom Relate Fields (i.e. Studio-Created) With No Relationship

Process Definitions Evaluate In Sugar 11.0 and higher, it is possible to evaluate relate fields generated by a relationship as well as to evaluate fields on the related module via its relationship in Module Field Evaluations. In Sugar 12.0 and higher, it is also possible to evaluate relate fields generated by a relationship in Relationship Change Evaluations. In Sugar 11.0 and higher, it is possible to evaluate Studio-created relate fields in Module Field Evaluations, but it is not possible to evaluate fields on the related module because there is no relationship in Studio. In Sugar 12.0 and higher, it is also possible to evaluate Studio-created relate fields in Relationship Change Evaluations.
Update It is not possible to update (e.g. in Add Related Record or Change Field actions) relate fields generated by a relationship but it is possible to update fields on the related module via its relationship. It is not possible to update Studio-created relate fields. It is also not possible to update fields on the related module because there is no relationship in Studio.
Process Business Rules Evaluate It is not possible to evaluate (i.e. use in conditions) relate fields generated by a relationship but it is possible to evaluate fields on the related module via its relationship. It is not possible to evaluate Studio-created relate fields. It is also not possible to evaluate fields on the related module because there is no relationship in Studio.
Return It is not possible to return relate fields generated by a relationship but it is possible to return field values on the related module via its relationship. Therefore, since business rules convert all return values to text, you can mimic actually returning the relate field value by returning the Name field of the related record. It is not possible to return Studio-created relate fields. It is also not possible to return field values on the related module because there is no relationship in Studio.
Update It is not possible to update relate fields generated by a relationship but it is possible to use fields on the related module via its relationship to update the value of other fields on the target module. It is not possible to update Studio-created relate fields. It is also not possible to use fields on the related module to update the value of other fields on the target module because there is no relationship in Studio.
Process Email Templates Insert It is not possible to insert variables and record links based on relate fields generated by a relationship but it is possible based on the related module itself via its relationship. It is not possible to insert variables and record links based on Studio-created relate fields. It is also not possible to do so based on the related module itself because there is no relationship in Studio.

Using Relate Fields in SugarBPM

Relationships have always been available in process definitions for evaluation of the related module's fields. This includes the relationships by which relationship-based relate fields (i.e. fields automatically created from a relationship, which includes all stock relate fields) are created.

In Sugar 11.0 and higher, all relate fields, whether based on a relationship or not, have been made available for use in evaluations in process definitions. However, for Studio-created relate fields specifically, the related module's fields cannot be accessed or updated in SugarBPM since the module does not have a relationship in Studio. To avoid this limitation, the solution is to only use relate fields that are automatically generated from a relationship. If your module already has functioning Studio-created relate fields, the only workaround to expose them to more SugarBPM functionality is to replace them with relationship-based relate fields. The following steps outline the process for doing this:

  1. Manually add the desired relationship to Studio, which automatically creates a relate field available in Studio. You can update the name of the field in Layouts > Record View.
  2. Migrate the data in your Studio-created field to the automatically-generated relate field. For example, if you have access to your instance's database and feel confident making direct database updates, you can migrate the data using database queries. It is important to ensure that you test all queries in a development environment first and that you have a backup of your production database before doing this.
  3. Hide or remove the Studio-created relate field and use the new automatically-generated relate field in SugarBPM as described in the table above.

Note that, if you have an existing Studio-created relate field, you cannot simply manually create a relationship to match it so that you can access it further in SugarBPM. Creating that relationship automatically creates an additional relate field representing the same data as your Studio-created relate field. The automatically-created one can be used in SugarBPM in the same way as stock relate fields, but the manually created one still cannot.