Skip to main content

Adding Custom Fields

Summary

You may have custom field data in SAP that you want to display within Salesforce. We’ll walk you through how to display these custom fields in Surface components.

Introduction

To add or change any custom fields your SAP team will populate one of several user-defined data tabs or custom fields using the BADI extension points for the enosix RIOs. The custom fields tabs on the RIO are used to populate detail components, there is no limitation on the number of custom fields on detail components. The Custom 1-10 slots are used to populate custom fields on the search components, there is a limit on the number of custom fields on the search components. For search component once the custom field is populated in SAP the field can be displayed by enabling the field.

Note: All custom fields data is returned as strings, any formatting will be performed in the SAP Exit points.

Below is an example of a USER_DEFINED data tab in SAP.

Detail Components

****Surface custom field configuration definitions are controlled by custom metadata records in Salesforce.

The following Surface detail components can be extended with custom fields:

  • Company Info
  • Customer Details
  • Customer Sales Areas
  • Delivery Detail
  • Invoice Detail
  • Sales Document Detail Header
  • Sales Document Item Detail

Metadata Settings

In order to display your SAP custom field data in Salesforce, you must create Custom Metadata Types. This includes creating at least one SAP Component Custom Field Group and one SAP Custom Field Definition.

Creating an SAP Component Custom Field Group Record

Think of the Custom Metadata Type SAP Component Custom Field Group as the top-level preset for defining the custom fields that will be displayed in a Surface component. Each SAP Component Custom Field Group that you define will be associated with a specific Surface component (example: you can create a "CD_Fields" group for the Customer Details component).

Not all Surface components are custom-field enabled. The ones that are have the Custom Field Presets drop-down visible in the Lightning App Builder when the Surface component is placed in a page.

Follow these steps to configure an SAP Component Custom Field Group record:

  • In the Setup Quick Find box, type "Custom Metadata", then click the Custom Metadata Types link.
  • Click the Manage Records link next to SAP Component Custom Field Group.

  • The SAP Component Custom Field Groups screen displays. Click the New button. The SAP Component Custom Field Group screen displays.

Edit the Fields in the SAP Component Custom Field Group Screen

  • Fill in the appropriate information for your custom field:
    • Component - Select a Surface component from the drop-down list (example: Customer Details). Your custom field will display in this component when the component is selected/displayed.
    • Label - Enter a text label that describes the contents of your custom field group (example: enter "CD Fields" for Customer Details Fields).
    • SAP Component Custom Field Group Name - This is an auto-generated unique name that will be used by the Salesforce API and managed packages (example: if you enter "CD Fields" in the Label field, "CD_Fields" will be the auto-generated unique name for this field).
    • User-Defined Type - This is a pre-filled field that contains the appropriate SAP user-defined data tab name (example: "USER_DEFINED").
    • Protected Component - Leave this box unchecked since it's irrelevant to this component.

  • Click the Save button.

Creating an SAP Custom Field Definition Record

You use the Custom Metadata Type SAP Custom Field Definition to define the custom fields that will be displayed in the Surface component. You can add SAP Custom Field Definitions anytime to a Surface component. This way, you can configure your initial custom fields, then add more custom fields to a Surface component as needed.

Follow these steps to configure an SAP Custom Field Definition record:

  • In the Setup Quick Find box, type "Custom Metadata" and click Custom Metadata Types.
  • Click the Manage Records link next to SAP Custom Field Definition.

  • The SAP Custom Field Definition screen displays. Click the New button. The SAP Custom Field Definition Edit screen displays.

Edit the Fields in the SAP Custom Field Definition Screen

  • Fill in the appropriate information for your custom field:
    • Default Label - Enter a text label that describes the contents of your custom field (example: "CD User Name"). This label will be displayed as a field label/column label, depending on how the Surface component is displayed.
    • Label - Enter a text label that identifies the metadata record.
    • SAP Custom Field Definition Name - This is an auto-generated unique name that will be used by the Salesforce API and managed packages (example: if you enter "CD User Name" in the Label field, "CD_User_Name" will be the auto-generated unique name for this field).
    • Custom Label - Enter a text label to be used as the field label/column label. This field provides multi-lingual support.
    • SAP Field - Enter the name of your custom field that's defined in SAP (in the example below, the SAP Field name is "ERNAM").
    • SAP Custom Field Definition - Use the lookup box to find the preset you want to connect the field to (the preset must exist in the SAP Component Custom Field Group; example: "CD_Fields").
    • Column Order - Enter a numeric value that determines the order in which to display this custom field relative to other custom fields.
    • Protected Component - Leave this box unchecked since it's irrelevant to this component.

Example SAP field

  • Click the Save button.

Configuring the Custom Field Preset

To configure Custom Field Presets with Lightning Flow for Surface version 1.7.1 and higher, see Configuring Custom Fields Using Lightning Flow.

For FlexiPages, see Configure Custom Fields for Lightning App Builder.