Configure Compound Fields in Salesforce
Configure Compound Fields in Salesforce

Configure Compound Fields in Salesforce

The Context:

One of the essential features of Salesforce is its ability to create custom fields that can be used to capture and store data relevant to a business. Among these custom fields are compound fields, which are a type of field that combines two or more fields into a single field. In this blog post, we will explore compound fields in Salesforce and how they can be used to enhance the functionality of the platform.

What are Compound Fields?

Compound fields in Salesforce are fields that combine two or more fields into a single field. These fields can be used to capture data from different sources and present it in a more meaningful way such as a location or an address. Compound fields are read-only fields, which means that they cannot be edited directly. Instead, the data in a compound field is derived from other fields in the Salesforce record. The value in a compound field is automatically calculated based on the values of the component fields.

Types of Compound Fields

There are several types of compound fields in Salesforce, including:

1.????Address: Address fields are used to store the complete address of a record. The address field combines several fields, such as Street, City, State, Postal Code, and Country, into a single field. This makes it easy to display the complete address of a record in a single field.

With Custom Address Field, you can add and retrieve address data via custom Address compound fields on Salesforce standard and custom objects. Follow the below steps to Enable Custom Address Field:

Step 1. Enable custom address fields.

NOTE: Custom address fields can’t be disabled again.

i)?????Follow below steps to enable the custom address field in Salesforce.

ii)????Go to Setup | Search for User Interface.

iii)???Select User Interface.

iv)???Click on Use custom address fields and click on Save.

Implement State and Country Picklist (Optional if you want to use default picklist)

No alt text provided for this image

Step 2. Create a Custom Address field.

You can create custom address field on standard or custom object. You need to follow below steps.

i)?????Click on Setup | Select object Manager

ii)????Select Object

iii)???Click on Field & Relation then select Data Type as Address.

iv)???Then add field Name and API name.

v)????Add the field on page layout.

No alt text provided for this image

Once field is created, by default, all countries, territories, and their states will be visible to end user on custom address field. If State and Country/Territory Picklists aren’t enabled in your org, the State and Country components of the standard Address fields remain free text fields.

?

1.????Geolocation: Geolocation fields are accessible in the SOAP and REST and are used to store the latitude and longitude of a location. The geolocation field combines two fields, Latitude and Longitude, into a single field. In addition to storing the latitude and longitude values, the Geolocation field also provides built-in functionality to display the location on a map. This allows users to visualize the location of a record on a map and perform proximity searches.


Geolocation fields are provided on many standard objects, such as Account, Contact, Quote, and User, as part of their address field or fields. Geolocation fields can also be added as custom fields to standard or custom objects.

Steps to create Geolocation are like creating Address field

No alt text provided for this image
No alt text provided for this image

NOTE: Although geolocation fields appear as a single field in the user interface, custom geolocation fields count as three custom fields towards your organization’s limits: one for latitude, one for longitude, and one for internal use.

Benefits of Compound Fields

There are several benefits to using compound fields in Salesforce, including:

  • Data Integrity: Compound fields help ensure data integrity by reducing the chances of data entry errors. Since the values in a compound field are derived from other fields, the data in the compound field is always accurate and up to date.
  • Reporting: Compound fields can be used in reports and dashboards, making it easy to analyze and report on data stored in Salesforce.
  • Better user experience: Compound fields provide a better user experience by presenting related data in a single, easy-to-understand field. This can help users quickly access the information they need and make informed decisions.

Limitations on Compound Fields

Both address and geolocation compound fields have the following limitations.

As Compound fields are read-only, to update field values, modify the individual field components.

  • Compound fields are accessible only through SOAP API, REST API, and Apex. The compound versions of fields aren’t accessible anywhere in the Salesforce user interface.
  • Custom geolocation and location fields on standard addresses aren’t supported with email templates.
  • You can’t use compound fields in lookup filters, except to filter distances that are within or not within given ranges. You can use distance lookup filters only in the Metadata API.


Limitations of Address Compound field:

  • Address fields aren’t filterable, however the isFilterable() method of the DescribeFieldResult Apex class erroneously returns true for address fields.
  • Compound address fields are available only for address fields that exist as part of the standard objects included in Salesforce.

Limitations of Geolocation Compound field:

  • Geolocation fields aren’t supported in custom settings, and they aren’t available in dashboards or Schema Builder.
  • Geolocation fields and latitude and longitude on standard addresses aren’t supported in Salesforce to Salesforce.

Conclusion

Compound fields are an essential feature of Salesforce that can be used to enhance the functionality. They help ensure data integrity, make the user interface more user-friendly, and can be used in reports and dashboards to analyze and report on data stored in Salesforce. By understanding the different types of compound fields and how they can be used, businesses can make the most of Salesforce and improve their sales, marketing, and customer service processes.

Reference


Author: Prasant Satpathy

Visit Us:?corp.infogen-labs.com ?

Social Media:?Instagram ?|?Facebook ?|?LinkedIn ?|?YouTube ?|?Twitter

要查看或添加评论,请登录

社区洞察

其他会员也浏览了