Skip to main content

Managing Web Components

The InCountry Data Residency for Salesforce package provides the following web components:


InCountry Activities

Description

The InCountry Activities component is a replacement for the native Salesforce component - Activities. This component renders the list of activities in chronological order in breakdown by activity type.

When needed

Display fields with open activities and activity history on the record.

Configuring the InCountry Activities component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Additional activity description fields box, list names of fields to display on the component. (Optionally)

  4. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  5. Activate the page layout.


InCountry Activity

note

This component is supported in the three-model package for the redaction and restriction models.

The InCountry Data Residency for Salesforce package provides the Activity component as a replacement for the native Activity component.

Adding the Activity component to the page layout

note

Please follow these instructions if you use Salesforce Lightning.

  1. Open the list for a specific object and select a specific record.

  2. Click Setup, then select Edit Page.

  3. On the Lightning App Builder page, add a new tab. Select Custom and enter a custom label.

  4. Drag the activityPanel component to the tab.

    Lightning App Builder page

  5. Regulate the visibility of components by adding filters.

    Lightning App Builder page - Filtering parameters

  6. Click Save.

  7. Click Activation and activate the modified page.

Working with the Activity component

The Activity component allows you to manage tasks, log calls, and schedule events with your customers and prospects. InCountry’s equivalent of this component resembles the native Salesforce component and provides a similar user experience.

Creating a new task activity

  1. Within the Activity component, locate the New Task tab and select it.

  2. Click Add new Activity.

    Activity block

  3. Fill out details of a new activity.

  4. Click Save.

Filtering task activities
  1. Select the New Task tab.

  2. Locate the Filter icon and click it.

  3. Define the filtration criteria.

  4. Click Apply or Apply & Save (to permanently save the filtration criteria).

Activity block - Filtration criteria

Logging calls

  1. Select the Log a Call tab.

  2. Enter the log summary.

  3. Click Save.

Log a Call block

Managing events

  1. Select the New Event tab.

  2. Fill in details for the event.

  3. Define the event time.

  4. Click Save.

New Event block

Closing tasks

  1. Locate the Task Timeline block.

  2. Locate the task you want to close and hover over it.

  3. Check the box. The task is closed.

    Task Timeline block

  4. If you closed the task accidentally, clear the box.

    Choose Status form

  5. In the Choose Status form, select the current status of the task.

  6. Click Save.


InCountry Activity Highlights Panel

note

The InCountry Activity Highlights Panel component is displayed for the Task and Event Salesforce objects in the record details view only.

Description

The InCountry Activity Highlights Panel component is a replacement for the native Salesforce component - Highlights Panel presented for the activity object. This component renders the header that contains page-level actions and the block of key activity fields.

note

This component should be used only for the Task and Event objects instead of the InCountry Highlights Panel component.

When needed

Display key information for specific activities, such as tasks and events.

Configuring the InCountry Activity Highlights Panel component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Activity Record Detail

note

The InCountry Activity Record Detail component is displayed in the record details view only.

Description

The InCountry Activity Record Detail is a replacement for the native Salesforce component - Record Detail which should be configured specifically for the Activity object. This component renders the block of fields displaying the activity record information.

When needed

Display fields with sensitive and generic information about records pertaining to the Activity object.

Configuring the InCountry Activity Record Detail component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


note

The InCountry Activity Related List Single component is displayed in the record details view only.

Description

The InCountry Activity Related List Single component is a replacement for the native Salesforce component - Related List Single displayed for the Activity object. This component renders a list of related activities for a record.

When needed

Display a list of related records for the following objects:

  • Task
  • Open Activity
  • Activity History
  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Field API Name box, enter the API name of the lookup field to display the Salesforce object (for example whatID, whoID). For the details, please see documentation.

  4. In the Object API Name box, enter the Salesforce Activity object whose data you want to display (for example Task, Event).

  5. In the Field Set API Name box, enter the API name of the Field Set. The field set defines which fields will be displayed on the component. The field set can be created in Object Manager. If you want to use the standard InCountry Field Set, add a namespace (for example testInCountry1__default).

  6. Select the related list type:

    1. Default - display a default related list type.

    2. Basic List - display records as a list.

    3. Tile - display records as a tile.

  7. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  8. Activate the page layout.


InCountry Chatter

Description

The InCountry Chatter component is a replacement for the native Salesforce component - Chatter. This component renders a feed with emails on the record detail page.

When needed

Display a feed listing emails pertaining to the opened case.

Configuring the InCountry Chatter component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry History Report

Description

The InCountry History Report component displays a historical report on record changes.

When needed

Display a historical report on record changes.

Configuring the InCountry History Report component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry List View

Description

The InCountry List View component is a replacement for the native Salesforce component - List View. This component renders the list of records with regulated data and allows you to scroll down the list of these records.

When needed

Display a list of records with regulated data queried from the InCountry platform.

Configuring the InCountry List View component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Object API name box, enter the Salesforce object whose data you want to display.

  4. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  5. Activate the page layout.


InCountry Notes & Attachments

note

The InCountry Notes & Attachments component is displayed in the record details view only.

Description

The InCountry Notes & Attachments component allows you to view, download and upload files pertaining to the currently opened Salesforce record. Such attachments are managed on the InCountry platform and are not physically stored in Salesforce according to the compliance requirements.

When needed

Manage attachments in a compliant way in Salesforce.

Configuring the InCountry Notes & Attachments component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.

Supported File Types

File extensionSalesforce object typeSupport
.docContact, CaseYes
.html/htmContact, CaseYes
.jpgContact, CaseYes
.msgContact, CaseYes
.pdfContact, CaseYes
.pngContact, CaseYes
.rtfContact, CaseYes
.tifContact, CaseYes
.txtContact, CaseYes
.docxContact, CaseYes
.pptxContact, CaseYes
.xlsxContact, CaseYes
.jpegContact, CaseYes

Working with duplicates

For the web component approach, duplicates can be stored on the InCountry platform.

note

The InCountry platform can store duplicated files. The web component generates the unique name for every file by adding a timestamp to the name of the file.

Example of generated file name:
timestamp001__fileName.pdf


InCountry Opportunity Products

note

The InCountry Opportunity Products component is displayed in the record details view only.

Description

The InCountry Opportunity Products component renders all product records associated with the opened opportunity.

When needed

Display products related to a specific opportunity.

Configuring the InCountry Opportunity Products component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Path Assistant

note

The InCountry Path Assistant component is displayed in the record details view only.

Description

The InCountry Path Assistant component is a replacement for the native Salesforce component - Path. This component gives sales representatives a visual representation of the stages throughout the sales pipeline.

When needed

Display a visual representation of a business process and manage stages across the sales pipeline.

Configuring the InCountry Path Assistant component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. From the Path API name drop-down list, select the Path Assistant name.

  4. From the Picklist Field drop-down list, select the field to display data from.

  5. In the Label of last step box, enter the label name for the last step in the pipeline.

  6. Select the checkbox Hide path update button to remove the Path Update button.

  7. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  8. Activate the page layout.


InCountry Quote Line Items

note

The InCountry Quote Line Items component is displayed in the record details view only.

Description

The InCountry Quote Line Items component is a replacement for the native Salesforce component - Quote Line Item. This component is automatically created when the Quote is created from an Opportunity based on the Opportunity Products attached to that Opportunity.

When needed

Represents a quote line item, which is related to a product item (Product2 object) associated with a Quote, along with other information about those line items on that quote.

Configuring the InCountry Quote Line Items component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.

note

For the details on how to regulate calculated fields on the Quote object, please check our documentation


InCountry Record Detail

note

The InCountry Record Detail component is displayed in the record details view only.

Description

The InCountry Record Detail component is a replacement for the native Salesforce component - Record Detail. This component renders the block of fields displaying the record information.

When needed

Display fields with sensitive and generic information about records pertaining to a specific Salesforce object.

Configuring the InCountry Record Detail component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the component property editor, check the box Enable Google Search in Address Fields if you want to enable address lookup using Google Maps.

  4. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  5. Activate the page layout.


InCountry Potential Duplicates

note

The InCountry Potential Duplicates component is displayed in the record details view only.

Warning

The InCountry Potential Duplicates component cannot be used without the InCountry Highlights Panel and InCountry Record Detail components, otherwise duplicates are not displayed.

Description

The InCountry Potential Duplicates component renders the duplicate records for the currently opened record. Potential duplicates are found based on the native Salesforce Duplicate Rules and the matching rule methods activated on the object.

Warning

To enable the InCountry Potential Duplicates component, please follow the next steps:

  1. Activate the Duplicate record management flag.

  2. Generate the Deterministic tokenization key in Settings. The hash function should be: [formula, dtkSha256].

  3. Configure the policy and protected fields for the necessary object by using the hash function [dtkSha256, formula].

When needed

Display duplicate records for a specific Salesforce record.

Configuring the InCountry Potential Duplicates component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Highlights Panel

Description

The InCountry Highlights Panel component renders the header that contains page-level actions.

When needed

Display links to perform quick actions on the record.

Configuring the InCountry Highlights Panel component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Record History

note

The InCountry Record History component is displayed in the record details view only.

Description

The InCountry Record History component is a replacement for the native Salesforce component - Related List Single. This component renders records related to the record history.

When needed

Display the record history.

Configuring the InCountry Record History component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


Description

The InCountry Related List Quick Links component is a replacement for the native Salesforce component - Related List Quick Links. This component renders multiple links to preview related list data.

When needed

Display the links to view all the related list columns without opening the View All page.

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Limit of records box, specify the maximal number of records to display.

  4. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  5. Activate the page layout.


note

The InCountry Related List Single component is displayed in the record details view only.

Description

The InCountry Related List Single component is a replacement for the native Salesforce component - Related List Single. This component shows a list of related records for a specific Salesforce record.

note

The InCountry Related List Single component does not support the Activity and Opportunity products since these objects have special components.

When needed

Display a list of related records for a specific Salesforce record.

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Child Object’s Lookup field API Name box, enter the API name of the lookup field from the child object to display the Salesforce object (for example AccountID).

  4. In the Child Object’s API Name box, enter the Salesforce object whose data you want to display (for example Contact).

  5. In the Child Object’s Field Set API name box, enter the API name of the field set from the child object. A field set defines which fields will be displayed on the component. A field set can be created in Object Manager. If you want to use the standard InCountry Field Set, add a namespace (for example testInCountry1__default).

  6. Select the related list type:

    1. Default - display a default related list type.

    2. Basic List - display as List.

    3. Tile - display as Tile.

  7. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  8. Activate the page layout.

Creating a field set for the Campaign Member object

A field set defines which fields will be displayed on the component. To create a field set for the Campaign Member object, follow these instructions:

  1. From Setup, select Object Manager.

  2. On the list with objects, search for the CampaignMember custom object by its system name and click it. The actual object name may vary depending on the package version.

  3. On the sidebar, click Field Sets.

  4. In the top right part of the screen, click New.

  5. In the Field Set Label box, enter the label of the field set for the Campaign Member object.

  6. In the Field Set Name box, enter the API name of the field set for the Campaign Member object.

  7. In the Where is this used? box, enter description where the field set is used for the Campaign Member object.

  8. When complete, click Save.

  9. Click the down arrow icon next to the field set you created and select Edit.

  10. Drag the Status field to the layout of the form to add the Status field to the field set.

  11. Click Save.

note

The Status field is required for operation of the InCountry Related List Single component for the Campaign Member object.

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Child Object’s Lookup field API Name box, enter CampaignID.

  4. In the Child Object’s API Name box, enter CampaignMember.

  5. In the Child Object’s Field Set API name box, enter the API name of the field set you created.

  6. Select the related list type:

    1. Default - display a default related list type.

    2. Basic List - display as a list of records.

    3. Tile - display as a tile of records.

  7. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  8. Activate the page layout.


Description

The InCountry Related Record component is a replacement for the native Salesforce component - Related Record. It displays the details of a related record, including the details of a parent record.

When needed

Display the records related to a particular record. For example, If you are looking at a contact, you can see a related Account record for this contact.

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Lookup Field box, enter the API Name of the lookup field.

  4. In the Page layout box, enter the object’s layout name in the following format (ObjectApiName-LayoutApiName).

  5. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  6. Activate the page layout.


InCountry Search Panel

Description

The InCountry Search Panel component renders a search panel to look up records stored on the InCountry platform.

When needed

Display a search panel to look up records stored on the InCountry platform.

Configuring the InCountry Search Panel component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Search Tab

Description

The InCountry Search Tab component renders a tab to look up records stored on the InCountry platform.

note

The InCountry Search Tab component is used as a container for the InCountry Search Box and InCountry Search Results components. You need to place both components into this container. Without adding the InCountry Search Results component, no search results are displayed in the InCountry Search Tab component.

When needed

Perform record lookup across the InCountry platform.

Configuring the InCountry Search Tab component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


Description

This component allows you to search records on the InCountry platform. The results are shown in the InCountry Search Results component.

note

The InCountry Search Box component cannot be used without the InCountry Search Results component, otherwise search results are not displayed.

When needed

Look up regulated records stored on the InCountry platform.

Configuring the InCountry Search Box component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Search Results

Description

This component renders search results of the regulated records stored on the InCountry platform.

note

The InCountry Search Results component cannot be used without the InCountry Search Box component, otherwise search results are not be displayed.

When needed

Display search results of the regulated records stored on the InCountry platform.

Configuring the InCountry Search Results component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. Select the view to render search results:

    1. Table - display results in a table.

    2. Tile - display results as a tile.

  4. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  5. Activate the page layout.


InCountry Settings (legacy)

Description

The InCountry Settings (legacy) component renders the configuration section to manage data regulation policies and protected fields in the InCountry Data Residency for Salesforce package.

When needed

Display the configuration section to manage data regulation policies and protected fields.

Configuring the InCountry Settings (legacy) component

  1. In Lightning App Builder, drag the component to the layout.

  2. Select the component to open the settings in the right part of the screen.

  3. In the Set Component Visibility expand block, click + Add Filter. Define the filtration criteria for the component visibility on the layout according to your needs.

  4. Activate the page layout.


InCountry Email Message (Redacted/Restricted model)

When you use the redaction or restriction data regulation policies, redacted data is stored in Salesforce. This can cause problems when communicating with contacts or leads by email. The package provides the Email Message component that allows you to send emails with redacted values that will be unredacted by Email Gateway.

Prerequisites

Configure the Email Gateway which can accept requests from Salesforce.

  • Create an Email Gateway on the InCountry Portal. As the result, you will get credentials to integrate with Email Gateway.

Configuring the Email message component

Warning

Before configuring the Email Message component, please register an email gateway within the same environment and country which your Salesforce service is attributed to.

To enable the email processing by Email Gateway, you need to perform the following steps:

Creating an email relay

You need to set up an email relay for Salesforce-generated emails by configuring Salesforce to automatically route emails through your company’s SMTP server. If your company sends emails from more than one email domain, you can configure an email relay for each domain.

  1. From Setup, select Email, then select Email Delivery Settings, finally, click Email Relays.

  2. On the list with email relays, click Create Email Relay.

    Create Email Relay

  3. Configure the email relay as follows:

    • Host - enter the address of the Border host you received when creating a Border configuration (for example, (se-proxy-mt-01.staging.incountry.io)).

    • Port - specify the SMTP port as 587.

    • TLS Setting - select the Required Verify option.

    • Enable SMTP Auth - check the box to enable SMTP authentication.

    • Auth Type - select the Auth Plain option.

    • Username - enter the Client ID that you received on the InCountry Portal after registering an email gateway.

    • Password - enter the Client Secret that you received on the InCountry Portal after registering an email gateway.

    • Confirm Password - re-enter the Client Secret.

  4. Click Save.

Creating organization-wide SMTP addresses

When sending emails from Salesforce, you can select your own email address or the organization-wide email address from which the email will be sent (the From field).

  1. From Setup, select Email, then click Organization-Wide Addresses.

  2. Click Add.

    Creating Organization-wide SMTP Addresses

  3. Fill out the following fields:

    • Display Name - specify the name explaining who an email is sent from.

    • Email Address - specify the email address which the letter will be sent from.

  4. Choose the user profile for this email address.

  5. Click Save.

Upon completion of this step, a verification email will be delivered to your mailbox.

Creating an email domain filter

An email domain filter determines whether an email relay is restricted to specific domains. You can create multiple domain filters and set their priority order. An email domain filter must be set up for email relay to work.

  1. From Setup, select Email, then select Email Delivery Settings, finally, click Email Domain Filters.

  2. Click Create Email Domain Filter.

    Create Email Domain Filter

  3. Enter the following information:

    • Sender Domain - leave it empty (leave the * (asterisk) sign as-is).

    • Recipient Domain - leave it empty (leave the * (asterisk) sign as-is).

    • Email Relay - select the email relay that you have created.

    • Active - check the box to activate the email domain filter.

  4. Click Save.

Configuring email deliverability

When you send emails from Salesforce, you would like to deliver emails to your recipients as coming from your domain instead of https://salesforce.com. The latter can cause problems in email deliverability and increase the chances of your emails being marked as spam. This is why you need to disable the Email Security Compliance feature.

  1. From Setup, select Email, then click Deliverability.

  2. Clear the Activate bounce management box.

  3. Clear the Enable compliance with standard email security mechanisms box.

    Clear the Enable compliance with standard email security mechanisms

  4. Click Save.


InCountry Email Message (Legacy Replicated model)

The InCountry Data Residency for Salesforce package provides the Email component supporting the data compliance when sending emails from Salesforce.

Configuring the Email Message component

To configure the Email message component for the replicated model, you need to perform the following steps:

Creating a data regulation policy

  1. On the menu, select Settings.

  2. In the Select Object box, select the Email Message object and click Add Policy. The Add Policy form opens.

    Add policy form

  3. In the Type box, select record. The data regulation policy will be applied to Salesforce objects of the record type. This means, that each email message (as a record) will be saved to the country of origin based on the country attribution.

  4. In the Behavior box, select Replication.

  5. In the Destination Country box, select the country for storing and processing the regulated data according to the select data regulation model. The following steps will customize the Related To field shown below:

    Related To

  6. Move the Controlled By Parent toggle right to enable the inheritance of configuration from the parent object.

    Controlled By Parent

  7. In the Select Parent box, enter Related To ID (Account).

    note

    Please note that the User, Lead, and Contact objects are not supported by the Related To field. When you create a regulation policy for these objects, start entering and choose from the drop-down list Related To ID (Account) or any other Salesforce object that has the same field that the required object (User, Lead, or Contact) includes.

  8. In the Source Field box, enter the name of the field which stores the country value. For example: Country field.

  9. In the Source Field Value box, enter the name of the country as you specify it while creating records related to the Email Message object. The value stored within the field will be saved to the country you select in the Destination Country box. This configuration option is available at the record level only.

  10. Save the data regulation policy.

Adding the InCountry Apex trigger

The InCountry Apex trigger allows you to set automated deletion of email messages from the InCountry platform, when they are deleted from Salesforce. To add the InCountry Apex trigger, follow the steps below:

  1. Open the Developer Console.

  2. From the File menu, select New, then click Apex Trigger.

  3. Populate the trigger name and select the respective sObject. The name must be InCountryEmailMessage.

    Apex Trigger

  4. Click Submit.

  5. Replace the trigger body with the code below.

trigger InCountryEmailMessage on EmailMessage (before delete, after delete) {
SObjectType triggerType = Trigger.isDelete ? Trigger.old.getSObjectType() : Trigger.new.getSObjectType();

if (Trigger.isDelete && !InCountryReplicationTriggerHandler.disableTrigger && !InCountryReplicationTriggerHandler.alreadyExecuted(triggerType)) {

InCountryReplicationTriggerHandler handler = new InCountryReplicationTriggerHandler(triggerType.getDescribe().getName());
if (Trigger.isBefore) {
handler.handleBeforeDeleteEmailMessage();
} else {
handler.handleAfterDeleteEmailMessage();
InCountryReplicationTriggerHandler.registerExecution(triggerType);
}
}
}

Creating a Visualforce page with the Email Message component

note

Please follow these instructions if you use Salesforce Classic.

  1. Navigate to Setup.

  2. On the sidebar, select Custom Code, then select Visualforce Pages.

  3. Click New.

    Add Visualforce page

  4. On the Visualforce Page page, specify the following information:

    1. Label - enter the page label.

    2. Name - enter the page name.

    3. Description - enter the description of the page.

    4. Visualforce Markup - add the following Apex code of the Email Message component:

    <apex:page showHeader="false" standardStylesheets="false" sidebar="false" docType="html-5.0" standardController="Account" applyBodyTag="False" applyHtmlTag="False">
    <head>
    <apex:slds />
    <apex:includeLightning />
    </head>

    <body class="slds-scope">
    <div id="lightning" />

    <script>
    $Lightning.use("c:inCountryEmailApp", function() {
    $Lightning.createComponent("c:inCountryEmail",
    {
    recordId: "{!Account.Id}",
    objectApiName: "Account"
    },
    "lightning",
    function(cmp) {}
    );
    });
    </script>
    </body>
    </apex:page>
  5. Click Save.

    note

    The code snippet above is valid for the Account object. To make it valid for any other Salesforce object, enter the appropriate Salesforce object name in the following parts:

    • standardController="Account"

    • recordId: "{!Account.Id}"

    • objectApiName: "Account"

  6. Once you have saved the page, you need to add it to the Flexipage layout. Navigate to Setup.

  7. On the sidebar, select Objects and Fields, then select Object Manager.

  8. On the Object Manager page, locate the Salesforce object which you want to add the Email Message page for and select this object.

  9. On the sidebar, select Page Layouts.

  10. Add a new section.

    Adding block to page layout

  11. Select Visuaforce Pages.

  12. Locate the newly added Visualforce page with the Email Message component.

  13. Drag the Visualforce Page to the new section.

  14. Click the Properties icon.

  15. In the Visualforce Page Properties form, enter the height in pixels (by default, use 550 px) and check the box to show the scrollbar.

    Adding block to page layout

  16. Click OK.

Adding the Email Message component to the page layout

note

Please follow these instructions if you use Salesforce Lightning.

  1. Open the list for a specific object and select a specific record.

  2. Click Setup, then select Edit Page.

  3. On the Lightning App Builder page, add a new tab. Select Custom and enter a custom label.

    App builder - adding tab

  4. Click Done.

  5. Select the newly added tab on the page layout.

    App builder - adding component

  6. Drag the InCountryEmail component to the tab.

  7. Click Save.

  8. Click Activation and activate the modified page.