Enabling the debug mode
The InCountry Data Residency for Salesforce package allows you to activate the debug mode when the package works with the replication data regulation model. This mode lets you track the process of saving data records to the InCountry platform and ensure that they first appear on the InCountry platform and only then are replicated to Salesforce.
note
The debug mode is supported in the legacy package only.
Prerequisites
The replication model is enabled for the Salesforce organization.
The Chatter component is enabled at Setup > Chatter > Chatter Settings.
The Chatter component is available on Flexipages.
How to enable the debug mode
From Setup, click Custom Code, then select Custom Metadata Types.
On the list with custom metadata types, locate InCountry Flags and click Manage records for it.
Add a new entry:
DEBUG_MODE_ENABLED
.From Setup, click Objects and Fields, then select Object Manager.
On the list with objects, locate the
User
object and click it to open.On the navigation sidebar, select Fields & Relationships.
On the list with fields, locate the
InCountry Debug Mode (DebugMode__c)
field and click it.Ensure that FLS is configured for your user.
From Setup, click Objects and Fields, then select Object Manager.
On the list with objects, locate the
User
object and click it to open.On the navigation sidebar, select User Page Layouts.
Add the
DebugMode__c
field to the user page layout.In the top right part of the screen, click your user avatar.
Select Settings.
On the navigation sidebar, select Advanced User Details.
Click Edit.
In the InCountry Debug Mode box, select
Replication
.
How to use the debug mode
Select the regulated object and go to the corresponding list view for it.
Click New and create a new record.
Click Save and take a note that regulated data has not been saved to the Salesforce database.
Copy the
record id
from the URL and select the Find in InCountry tab.Ensure that the record has not been created yet on the InCountry platform.
Append the
_debug
snippet to therecord id
and ensure that the debugged record has been created on the InCountry platform. Such record retains a Salesforce Apex memory stamp. This information will be used during the next steps.Return to the created record, scroll down to the Chatter component and find the following message.
The message says that the pre-commit was performed, but the record has not been synchronized yet. Click the link below the message. You will be redirected to the Debug Mode Visualforce page.
On the opened page, you can view the synchronization status. Click Synchronize Record.
You will see a request to the InCountry platform and a response from it. Now, return to the Find in InCountry tab and ensure that the record has been created.
Return to the record and ensure that it still remains in the pre-commit state.
Check the next Chatter post.
Navigate to the page again. Click Perform Post-commit. You will see a request to the Salesforce database and a response from it.
Return to the record and ensure that it is in the post-commit state (a regulated/protected value should be in Salesforce).