BYOB - Field Label Overrider (GA)
Let’s first understand its usage by an example scenario
In large-scale Sales Cloud implementations, a company often has one global Account or Contact object. However, the legal definition of an "ID Number" of a contact changes drastically by country, but the purpose (uniquely identifying a tax entity) remains identical.
The Setup
For instance you have one custom field: National_ID__c on Contact.
The Dynamic Challenge
Instead of creating 50 different fields for 50 countries, Codeylab’s "Field Label Overrider" allows you to maintain one single data point while the UI adapts instantly based on the Mailing Country field.
If Billing Country is... | Field Label Dynamically Becomes... |
USA | SSN / EIN |
Brazil | CPF / CNPJ |
India | PAN / GSTIN |
UK / Europe | VAT Number |
Australia | ABN (Aust. Business Number) |
The "Before vs. After" Architecture
The "Painful" Standard Way (Without BYOB - Field Label Overrider)
To achieve this natively, an admin would have to:
- Create 50+ Custom Fields (e.g., SSN__c, VAT__c, CPF__c).
- Create 50+ Visibility Rules on the Lightning Record Page.
- Build Complex Formulas to merge all 50 fields into one "Master ID" for reporting.
- Manage Massive Page Layouts that are difficult to maintain.
Your "Field Label Overrider" Way
- One Field: You only manage National_ID__c.
- One Column: Your database remains lean, and Global Reporting is instant.
- Dynamic UI: The label transforms based on the MailingCountry value.
The following pages demonstrate how to use a single custom field, such as National_ID__c, and dynamically change its label on the record page based on the contact's country.
Phase 1: Initial Setup and Configuration
Before using the component, you must ensure the package is active and the system settings are defined.
1. Verify Installation: Navigate to Installed Packages in Setup and confirm that the "Build Your Own Branding" package is installed and Active.
2. Access Custom Settings: Go to Custom Settings in Setup, locate the setting named Byob Elements, and click Manage.
3. Define Organization Level Values: Create a new organization-level value (applicable to all users). You must define the following fields exactly as shown:
◦ PSC_normalViewElement: windowViewMode-normal.
◦ PSC_consoleViewElement: windowViewMode-maximized.
◦ Once saved, the BYOB components are ready for use on record pages.
Phase 2: Identifying API Names
To override a field label, you need the exact API names for both the object and the field.
1. Find Object API Name: In the Object Manager, locate the desired object (e.g., "Contact") and note its API Name.
2. Find Field API Name: Under the object's Fields & Relationships section, find the specific field you wish to override (e.g., "National ID") and grab its Field API Name (e.g., National_ID__c).
Phase 3: Configuring the Field Label Overrider
This process takes place within the Lightning App Builder.
1. Open Lightning App Builder: From a record page, click the Gear icon and select Edit Page.
2. Add the Component: Scroll through the Custom Managed Components list to find the Field Label Overrider.
Drag and drop it onto the record page; it is recommended to place it as the last component on the page.
3. Configure the First Override:
◦ Field Api Name: Enter the combined object and field name (e.g., Contact.National_ID__c).
◦ Override Field Label: Define the new label you want displayed (e.g., "SSN / EIN").
4. Set Visibility Filters: To make the override dynamic, expand Set Component Visibility (this is salesforce native feature). Add a filter so the component is only active under specific conditions (e.g., Record > Mailing Country Equal USA, when a text field is used for filter condition, filter value is case sensitive)
5. Add Multiple Overrides: To handle different scenarios, drag and drop another Field Label Overrider component below the first one. For example, set this one to override the label to "CPF / CNPJ" when the Mailing Country equals Brazil.
Phase 4: Testing and Verification
Once you have saved your changes in the Lightning App Builder, verify the behavior on the live record pages:
• Scenario A: When the contact’s mailing country is "Brazil", the "National ID" label should dynamically change to "CPF / CNPJ".
• Scenario B: When the mailing country is "USA", the label should change to "SSN / EIN".
• Fallback Behavior: If the record does not meet any of the defined visibility criteria (e.g., the country is neither USA nor Brazil), the field will display its original fallback label (e.g., "National ID")